Why's that every time a navigation composable that's on the bottom navigation
creates a new view model when the user clicks on the bottom navigation item
i'm using
val viewModel: LatestBooksViewModel = hiltNavGraphViewModel(navBackStackEntry)
i don't want to create a new view model each time the user clicks the bottom navigation since it's just wasting API calls
i
Ian Lake
03/10/2021, 9:34 PM
Navigation only saves the state of things on the back stack (i.e., can you press the back button to go back to that destination). You'll want to star the multiple back stack issue for updates on saving/restoring the state of individual bottom nav items: https://issuetracker.google.com/issues/80029773
K 1
f
FunkyMuse
03/10/2021, 11:18 PM
Does that mean that when navigation comes to support multiple stack, it'll do that independently whether it's composable or fragment?