Composable Function

LocalOwnersProvider

Provides this NavBackStackEntry as LocalViewModelStoreOwner, LocalLifecycleOwner and LocalSavedStateRegistryOwner to the content and saves the content's saveable states with the given saveableStateHolder.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free

LocalOwnersProvider

Common
@Composable
public fun NavBackStackEntry.LocalOwnersProvider(
    saveableStateHolder: SaveableStateHolder,
    content: @Composable () -> Unit,
)

Provides this NavBackStackEntry as LocalViewModelStoreOwner, LocalLifecycleOwner and LocalSavedStateRegistryOwner to the content and saves the content's saveable states with the given saveableStateHolder.

Parameters

saveableStateHolder The SaveableStateHolder that holds the saved states. The same holder should be used for all NavBackStackEntrys in the encapsulating Composable and the holder should be hoisted.
content The content Composable