rememberNavigationEventState

Functions summary

NavigationEventState<SceneInfo<T>>

Remembers and returns a NavigationEventState instance for a SceneState.

Cmn

Functions

rememberNavigationEventState

@Composable
fun <T : Any> rememberNavigationEventState(sceneState: SceneState<T>): NavigationEventState<SceneInfo<T>>

Remembers and returns a NavigationEventState instance for a SceneState.

This composable creates and remembers a NavigationEventState object, which holds a NavigationEventHandler internally. This is the state object that can be passed to NavigationBackHandler (the composable) to "hoist" the state.

The state's handler info (currentInfo and backInfo) is kept in sync with the provided sceneState.

Parameters
<T : Any>

the type of the key in the SceneState.

sceneState: SceneState<T>

the SceneState that this state will track.

Returns
NavigationEventState<SceneInfo<T>>

a stable, remembered NavigationEventState instance.