https://kotlinlang.org logo
#compose
Title
# compose
m

Marcello Galhardo

01/02/2021, 9:46 AM
Hey! I'm starting to play with compose and I have a question around
SavedStateRegistry
. I notice I have an
Ambient
for
UiSavedStateRegistry
but there's no for
SavedStateRegistry
. - and look like they are totally different types so I can't create a custom
AbstractSavedStateViewModelProviderFactory
without a
SavedStateRegistryOwner
. What is the correct way to get a
SavedStateRegistryOwner
in a composable? 🤔
i

Ian Lake

01/02/2021, 4:09 PM
If you are using Navigation Compose (https://developer.android.com/jetpack/compose/navigation), the
NavBackStackEntry
you get there is a
SavedStateRegistryOwner
👍 1
I'd suggest filing an issue for an ambient though, given that there's already ones for
LifecycleOwner
and `ViewModelStoreOwner`: https://issuetracker.google.com/issues/new?component=612128&template=1253476
👍 1
m

Marcello Galhardo

01/05/2021, 5:19 PM
Right, thanks @Ian Lake! Issue here.
👍 1