https://kotlinlang.org logo
#compose
Title
# compose
k

Karthick

10/20/2020, 1:46 PM
Why NavControllerAmbient removed, why it is need to pass to composable functions explicitly
a

Ali Albaali

10/20/2020, 1:53 PM
I think it has been renamed to AmbientNavController but I'm not sure
n

nickbutcher

10/20/2020, 2:10 PM
No it was removed. Generally explicit dependencies are good! They make it clearer what your code depends upon and harder to breach that contract.
👍 5
☝️ 2
a

Adam Powell

10/20/2020, 2:40 PM
the specific trouble case that encouraged this change is when you nest nav hosts and have multi-level navigation. An ambient only gives access to the most local value provided, so code that expects to be in the scope of an outer nav host and have access to the associated outer destinations would not find the correct controller.
✔️ 8
2