Composable Function

currentBackStackEntryAsState

Gets the current navigation back stack entry as a State.

currentBackStackEntryAsState

Source set: Android
@Composable
public fun NavController.currentBackStackEntryAsState(): State<NavBackStackEntry?>

Gets the current navigation back stack entry as a State. When the given navController changes the back stack due to a NavController.navigate or NavController.popBackStack this will trigger a recompose and return the top entry on the back stack.

Return

state of the current back stack entry

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: