Glad you liked it. I tend to delegate the navigation to the navigator implementation (hidden behind the interface). It obtains a reference to the NavHostController when it's created for the NavHost.
Good idea. The only problem I see here is that view model survives configuration change and has a reference to the old navigator when a new navigation controller is created in Composable. It can be replaced in view model, however, it could be tricky when using DI.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Glad you liked it. I tend to delegate the navigation to the navigator implementation (hidden behind the interface). It obtains a reference to the
NavHostController
when it's created for theNavHost
.Good idea. The only problem I see here is that view model survives configuration change and has a reference to the old navigator when a new navigation controller is created in Composable. It can be replaced in view model, however, it could be tricky when using DI.