ReusableContentHost

Composable Function

Common
@Composable
@ExplicitGroupsComposable
public inline fun ReusableContentHost(
    active: Boolean,
    crossinline content: @Composable () -> Unit,
)

An optional utility function used when hosting ReusableContent. If active is false the content is treated as if it is deleted by removing all remembered objects from the composition but the node produced for the tree are not removed. When the composition later becomes active then the nodes are able to be reused inside ReusableContent content without requiring the remembered state of the composition's lifetime being arbitrarily extended.

Parameters

activewhen active is true content is composed normally. When active is false then the content is deactivated and all remembered state is treated as if the content was deleted but the nodes managed by the composition's Applier are unaffected. A active becomes true any reusable nodes from the previously active composition are candidates for reuse.
contentthe composable content that is managed by this composable.