https://kotlinlang.org logo
#compose
Title
# compose
i

Ivan Šiser

10/03/2023, 8:55 AM
Hello guys! Does anybody know how to
clear arguments from backStackEntry
(jetpack compose navigation)? I have a case where I need to pass some arguments to composable via deep link. If arguments do exists, I need to show some modal with info inside. The problem is when I navigate to another screen from that composable and then go back, modal screen is shown again because arguments still exists inside backStack. Thanks
Copy code
backStackEntry.arguments?.remove("key")
Tried with this, but it’s not working
c

Csaba Kozák

10/03/2023, 9:13 AM
NavBackStackEntry arguments are immutable, you cannot change them. You should create another state in your ViewModel, and track there if you have showed the modal or not.
☝️ 1