ViewModels should be able to be scoped
Android has scoped ViewModels with navGraphViewModels as shown in here. Since we don't have navGraphViewModels in voyager, we can't use scoped states with ViewModels. (Although it may be possible using AndroidScreenLifecycleOwner. But I couldn't figure out how)
Same should apply to ScreenModel too.
@osrl Checkout pull request #217
will do. thank you very much.
I think my answer here apply to this issue as well: https://github.com/adrielcafe/voyager/issues/168#issuecomment-1766124366
you could also try this to have scoped viewmodels: viewModel<YourScopedViewModel>(viewModelStoreOwner = LocalContext.context.unwrapActivity)
I'm currently using this but my app is single activity and this makes it scoped to the entire app