I have a bug with rememberSaveable and maybe lived...
# compose
n
I have a bug with rememberSaveable and maybe livedata/savedStateHandle
Copy code
val value by it.savedStateHandle.getLiveData<String>("Value").observeAsState()
val rememberedValue by rememberSaveable(value) {
    mutableStateOf(value ?: "Empty")
}
When "Value" is set, rememberedValue remains Empty. If I use
remember(value)
or even
remember
, it works and display the content of value I have to add that it works when setting the value from the same Composable, but not when using Navigation with two screens (first screen display value, second screen set value and pop) :
Copy code
navController.previousBackStackEntry?.savedStateHandle?.set("Value", "value")
navController.popBackStack()
is it a known bug ?
well I made an issue https://issuetracker.google.com/issues/197661845 hoping I got some info and the tracker is right (I'm afraid it's linked to Navigation, and I'm also afraid I'm just doing something wrong/didn't understand something)