# ReusableContentHost

Common/AllAndroid/JVMNative/C/iOSJavaScript

## Functions summary

|---|---|---|
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable @https://developer.android.com/reference/kotlin/androidx/compose/runtime/ExplicitGroupsComposable https://developer.android.com/reference/kotlin/androidx/compose/runtime/ReusableContentHost.composable#ReusableContentHost(kotlin.Boolean,kotlin.Function0)( active: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, crossinline content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` An optional utility function used when hosting `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ReusableContent.composable#ReusableContent(kotlin.Any,kotlin.Function0)`. | Cmn |

## Functions

### ReusableContentHost

Cmn Artifact: [androidx.compose.runtime:runtime](https://developer.android.com/jetpack/androidx/releases/compose-runtime) [View Source](https://cs.android.com/search?q=file:androidx/compose/runtime/Composables.kt+function:ReusableContentHost) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.2.0)

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

An optional utility function used when hosting `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ReusableContent.composable#ReusableContent(kotlin.Any,kotlin.Function0)`. If `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#ReusableContentHost(kotlin.Boolean,kotlin.Function0)` 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 `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ReusableContent.composable#ReusableContent(kotlin.Any,kotlin.Function0)` content without requiring the remembered state of the composition's lifetime being arbitrarily extended.

| Parameters |
|---|---|
| `active: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | when `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#ReusableContentHost(kotlin.Boolean,kotlin.Function0)` is `true` `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#ReusableContentHost(kotlin.Boolean,kotlin.Function0)` is composed normally. When `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#ReusableContentHost(kotlin.Boolean,kotlin.Function0)` 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 `https://developer.android.com/reference/kotlin/androidx/compose/runtime/Applier` are unaffected. A `https://developer.android.com/reference/kotlin/androidx/compose/runtime/package-summary#ReusableContentHost(kotlin.Boolean,kotlin.Function0)` becomes `true` any reusable nodes from the previously active composition are candidates for reuse. |
| `crossinline content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the composable content that is managed by this composable. |