https://kotlinlang.org logo
#decompose
Title
# decompose
l

Landry Norris

08/02/2022, 6:24 PM
I’ve recently started using childContext, and in one project, I need to remove the contexts and replace them with new ones. I’d like to keep the keys the same, though. Is there a way to mark a childContext as removed and free the key for future use?
a

Arkadii Ivanov

08/02/2022, 10:20 PM
Sure! You should supply a
Lifecycle
to
childContext(...)
function. Then you can destroy the lifecycle. After that you should be able to create a new child component with the same key. See https://arkivanov.github.io/Decompose/component/overview/#adding-a-child-component-manually
3 Views