Jasmin Fajkic
08/21/2022, 4:52 PMCompositionLocalProvider
that provides navcontroller so that i do not need to pass navcontroller from parent down to child composable?Francesc
08/21/2022, 5:08 PMJasmin Fajkic
08/21/2022, 5:11 PMFrancesc
08/21/2022, 5:16 PMJasmin Fajkic
08/21/2022, 5:31 PMFrancesc
08/21/2022, 5:35 PMit should not know anything about navigationby adding a local composition that provides the navigation you are now having this dependency and having your comopsables know about navigation. The recommendation is to have lambdas that are called when the user initiates some action, and up in your root composable, in the navigation graph, those actions trigger a navigation event. The composable does not need to know what the user action ends up triggering, its only responsibility is to push that event up the chain to the point where it can be actioned
Jasmin Fajkic
08/21/2022, 8:40 PMColton Idle
08/22/2022, 3:51 AMjossiwolf
08/22/2022, 10:16 AMWe strongly recommended that you decouple the Navigation code from your composable destinations to enable testing each composable in isolation, separate from theI wrote a full explanation on how/why a while ago: https://medium.com/google-developer-experts/navigating-in-jetpack-compose-78c78d365c6acomposable.NavHost