Hey everyone! What's the recommended way of doing ...
# decompose
t
Hey everyone! What's the recommended way of doing dynamic number of child components? Say I have a grid, that grid is one component, but then each item would be a separate component.
childContext
requires a key
String
which I don't have. Also the number of items in the grid is dynamic, there will be more and less during the lifetime of the grid component.
a
It sounds like you need Generic Navigation - https://arkivanov.github.io/Decompose/navigation/children/overview/
t
Hmm, that feels like a lot for a list of items. I'll look into it though, thanks
a
You can use it as it is or create your own API based on it.
A dedicated API for dynamic lists is kinda wanted but it's not there yet. It would use the Generic Navigation under the hood.