https://kotlinlang.org logo
Title
l

Lazard

11/30/2020, 9:38 PM
Hi everyone ! I'm trying to use Kotlin Redux to keep the state of my app global. The only problem is that I have a nullable value in my store and changing it does not recompose my application. Changing an object property recompose the component displaying it, but going from null to something does not 😕 I've logged before dispatching my action (right value), after dispatching it (state has changed) and in the component displaying it (no log). Forcing the recomposition by hiding the component and showing it again works, but I feel terrible doing this 😅 Does anybody have an idea ? Maybe shouldn't I use Kotlin Redux ?
t

Timo Drick

11/30/2020, 11:45 PM
Can you provide the object definition. When you use MutableState objects it should be no problem when it is null. I am using it e.g. in this minimal sample app: https://gitlab.com/compose1/minimal-compose-desktop/-/blob/skia_crash/src/main/kotlin/main.kt