I have a rememberSaveable that has some derivedStateOf doing some calculations to return a class as the output.
I've already added Parceable/Parcelize to the class and it still crashes and tells me to implement a custom saver. I believe this is because I'm using derivedStateOf.
Am I allowed to save the state from a calculation output from derivedStateOf?
java.lang.IllegalArgumentException: DerivedState(value=MyClass(MyClass2())) cannot be saved using the current SaveableStateRegistry. The default implementation only supports types which can be stored inside the Bundle. Please consider implementing a custom Saver for this class and pass it to rememberSaveable().
The code looks like this
val someCalculation by rememberSaveable(someTriggering) {
derivedStateOf {
someCalculationThatReturnsAClass()
}
}