how to clear backstack with navigation compose lib...
# compose
h
how to clear backstack with navigation compose library?
m
if you are trying to clear everything, it's likely to be something like this. Basically, you'd have to get the start destination's route, and just do pop and include the start destination (if you want to go back to the start destination, you can use false instead of true)
Copy code
navController.popBackStack(navController.graph.startDestinationRoute, true)
h
yes unfortunately it’s not working. the screen just recomposes itself 3 times and goes nowhere
e
Definitely something wrong with your code, you will need to share how you set up your navigation graph
h
basically I have one composable for nav graph and it has two graphs inside one for auth and one main.
o
I think you have to set navigation options instead:
Copy code
navController.navigate("sign_in") {
    popUpTo(navController.graph.startDestinationId) {
        inclusive = true
    }
}