Open RYXCP opened 6 months ago
Can you try 1.6.0-beta02 and check if it's working for you?
oh, thanks! It does work
I'm having a similar issue on 1.6.0
. Any hint how to debug this?
I'm having a similar issue on
1.6.0
. Any hint how to debug this?
When i tried the "1.6.0-beta02", i found that it resolved this issue on its own.
Thinking more about it, I think this might be the desired behaviour or else deeplinks might break. All the parameteres should come from the deeplink url. But not 100% sure yet
I have a very similar issue in 1.6.0-rc05. The only difference in my case that I use 2 NavHost components and one is nested into other. And Screen in nested NavHost retains its initial value.
Here is example:
var screenType = ScreenType.MEDIUM ... @Composable fun NavGraph( navController: Navigator, screenType: ScreenType, ) { Text("${screenType}") NavHost( navigator = rememberNavigator(), initialRoute = Route.CHAT_ROUTE, ) { scene( route = Route.SETTING_ROUTE ) { NavHost( navigator = rememberNavigator(), initialRoute = Route.ENOTHER_ROUTE, ) { scene( route = Route.ENOTHER_ROUTE ) { Text("${screenType}") } } } } }
If you find that the screen always displays the previous value which is outdated, maybe these will help:
In current version, updating the value outside of a NavHost could not trigger the recomposition( I guess) , namely passing values directly into a NavHost is not recommended.
It seems like you want to observe to the window size, perhaps setting up a kotlin object and check it in somewhere or simply delaying the update to NavHost scope, will be better.
If you find that the screen always displays the previous value which is outdated, maybe these will help:
In current version, updating the value outside of a NavHost could not trigger the recomposition( I guess) , namely passing values directly into a NavHost is not recommended.
It seems like you want to observe to the window size, perhaps setting up a kotlin object and check it in somewhere or simply delaying the update to NavHost scope, will be better.
Thank you for suggestion! I moved to Navigation from JetBrains. It still in Alfa but it does not have this problem and my project is not commercial yet.
In 1.5.10, based on the sample app called Reply, I gave it a try. However, I found that the screenType in the scene retains its initial value while the one outside the NavHost is changed correctly.
Should I not have done this?