In which scenario can a LifecycleOwner change?
# compose
In which scenario can a LifecycleOwner change?
I don’t know specifically when that might happen, but it’s good style to always pass the dependencies that are used inside there as keys no matter what. If it needs to be keyed for correctness, just do it. If you have to think about “oh this never changes, so I won’t do it” you will end up with possible false negatives where you don’t pass something that you should, and that leads to incorrect behavior. In contrast, if you do pass something that guaranteed will never change, it’s still gonna work as intended. tl;dr always pass the correct dependencies as keys there, you can’t go wrong by doing so.
If it exists within a
, it could be reparented onto another tree that has a different LifecycleOwner (i..e., a different screen if you are using Navigation Compose)
👍🏻 1