Hello, question about navigation-compose I want t...
# compose
j
Hello, question about navigation-compose I want to add a
composable
destination to a NavHost at runtime. How do I do so without reloading the current Composable that is seen on the screen? By having a mutable state that is read from
NavHost
, the entire screen is refreshed (and animations look weird, state is reset etc)
i
This isn't how Navigation works. Your graph must have every possible destination in it when you create it. Think of it as a map of all possible destinations - that doesn't mean you have to use all of the destinations when your app runs though
j
Hm alright
i
Note that there's a semi-related issue with the NavHost losing state under certain types of recomposition, being tracked in https://issuetracker.google.com/172185423