Jan Skrasek
08/30/2021, 7:21 AMFelix Schütz
08/30/2021, 7:45 AMCompositionLocal
(https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal). But components lower down should probably not depend on the nav controller, since that makes testing more difficult.Filip Wiesner
08/30/2021, 8:17 AMCompositionLocals
to your project because they are a "hidden dependency" of sorts that makes it hard to reuse the components that depend on it.Jan Skrasek
08/30/2021, 8:22 AMFilip Wiesner
08/30/2021, 8:32 AMCompositionLocals
is that you can access them even in the leaf nodes of your tree like a button so it makes it easy to use it "wrongly".
And if you use the nav controller only on top of your tree, then it's not that hard to just pass a lambda 😄
Hope it makes senseIan Lake
08/30/2021, 2:48 PMjossiwolf
08/30/2021, 5:54 PM