I’ve recently started using childContext, and in o...
# decompose
l
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
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