# compose

Landry Norris

05/19/2022, 9:25 PM
I don’t see a separate channel for decompose, so I’ll ask my question here: I have a Component that has several instances of the same sub-component, which will get rendered in a Column. Each one has fairly complex logic and is independent from the others, so I’m thinking one Component class, and an array of instances. I can see here that I should use childComponent with a unique key. Is there a good way to create an array of childComponent built in, or should I have the keys be Bar0, Bar1, Bar2, etc?


05/19/2022, 10:26 PM
its about time we have a seperate channel for decompose @Arkadii Ivanov 😅
❤️ 1

Arkadii Ivanov

05/19/2022, 10:28 PM
Yeah, there is no channel. Some people are using #mvikotlin for this. But I will think about a separate channel. As mentioned in the docs, there are two ways of creating child components - via
and manually. In the latter case, they should have unique keys. So something like this should work (off the top of my head):
Copy code
val children = List(10) { index ->
        context = childContext(key = "Child$index"),
        // Other dependencies here
I have requested the channel creation, hopefully we'll have it -
🙌 1
🎉 1
The channel is created - #decompose . Everyone is welcome!
🙌 1