with Navigation 3, I've been clearing the backStac...
# compose-android
b
with Navigation 3, I've been clearing the backStack because I'm also setting state to the boolean that shows the NavDisplay to false, doing this I haven't ran into any exceptions, but should I just leave the last entry on the backStack and just update the state to hide the NavDisplay?
I also wonder if I should be doing
Copy code
onDismissRequest = {
    repeat(sheetEntries.size) {
        onBack()
    }
},
to handle the swipe to dismiss. which my NavDisplay onBack right now is
Copy code
onBack = {
    if (backStack.size > 1) {
        // Navigate back within the sheet
        backStack.removeLastOrNull()
    } else {
        // Close the sheet entirely
        // should this also backStack.clear() / backSTack.removeLastOrNull()
        hideReferSheet()
    }
},
or if I should figure out a way to just call hideReferSheet directly from the Sheet inside the SceneStrategy and not worry about clearing the backStack.
In practice it doesn't really seem like it matters since changing the flag will stop showing the NavDisplay and then showing it again will make a new NavDisplay. Just curious if there's a "cleanest" way of doing it. a swipe to dismiss on the sheet is just going through each entry one by one and calling on back.