<@UHAJKUSTU> Can I clarify exactly what the differ...
# decompose
a
@Arkadii Ivanov Can I clarify exactly what the difference between a
ChildSlot
vs a
ChildStack
. So far it feels like anything that could be a
ChildStack
could be implemented by using a
ChildSlot
. When is it a good idea to use a
ChildSlot
vs
ChildStack
? Any specific usecase you have in mind? Thanks in advance.
a
Child Stack manages a stack of components. It can't be empty. The top child is active (RESUMED), and the rest (the back stack) is inactive (CREATED). Prefer this model for push/pop operations, bottom navigation, etc. Child Slot contains either one active (RESUMED) child or none. Can be used for dialogs, bottom sheets, etc. Or to just dynamically attach/detach a component.
Technically, Child Stack can be used instead of Child Slot, but it's inconvenient. I don't see how vice versa is possible, though.
a
Thank you very much
👍 1