android / codelab-android-hilt

Apache License 2.0
355 stars 188 forks source link

Injecting NavController into a composable #19

Closed rupansh closed 3 years ago

rupansh commented 3 years ago

Going to other routes from a composable requires a NavController object There should be a way to inject this object (Possibly through ViewModel) as its very much a singleton dependency

hongwei-bai commented 3 years ago

same, I would rather not passing it through from the top level.

manuelvicnt commented 3 years ago

Please, feel free to add these feature requests to the Dagger/Hilt GH project (https://github.com/google/dagger/issues) instead of here. Thank you!