Jasmin Fajkic08/21/2022, 4:52 PM
that provides navcontroller so that i do not need to pass navcontroller from parent down to child composable?
Francesc08/21/2022, 5:08 PM
Jasmin Fajkic08/21/2022, 5:11 PM
Francesc08/21/2022, 5:16 PM
Jasmin Fajkic08/21/2022, 5:31 PM
Francesc08/21/2022, 5:35 PM
it 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 Fajkic08/21/2022, 8:40 PM
Colton Idle08/22/2022, 3:51 AM
jossiwolf08/22/2022, 10:16 AM
We 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.