I just updated all my compose dependencies to the ...
# compose
y
I just updated all my compose dependencies to the latest ones and my one (and only) composable screen that has a dynamic destination string and a viewmodel has issues. It launches without issues but crashes when I want to go back. I cant find how to fix it anywhere including here. Details on the thread:
My destination string is
options.folders.edit/{folderId}
and it used to work fine before these updates.
Now I get this error after trying to close the composable screen (with navigateUp)
java.lang.IllegalArgumentException: No destination with route options.folders.edit/{folderId} is on the NavController's back stack. The current destination is Destination(0x78d845ec) route=home
a
check the backstack if it’s there?
the internal code which throws that exception is pretty simple to debug
It might be caused by the new default crossfade transition animation bug
y
It had no issues in the past so I think its because of the new changes in Compose libraries.
Might be. I will investigate more.
i
Are you calling
getBackStackEntry
as part of composition? With animations, you're going to continue to get recomposed as you animate out (i.e., after your navigate call)
You can always wrap your call to
getBackStackEntry
in
remember
But if you're trying to get your own NavBackStackEntry, there's a reason that is passed to your composable lambda - use that one
🙌 1
y
@Ian Lake Thank you. I just used "it" instead of
getBackStackEntry
and its fixed. I dont know why I didnt use that originally.
🎉 2