voyager
voyager copied to clipboard
Recomposition issue when using nested Navigators and MaterialKolor
I'm the author of MaterialKolor, which is a library that generates a M3 MaterialTheme
based off a seed color.
I was using both MaterialKolor and Voyager in my app when I noticed an issue that only happened on iOS. The initial rendering of the MaterialKolor DynamicMaterialTheme
works just fine. But it will never be recomposed if the seed color changes.
I made a reproduction repo here. If you run the Android app, everything works fine. But if you run the iOS app, it won't recompose if you change the settings.
I've also got some recordings of what happens:
https://github.com/adrielcafe/voyager/assets/528792/97866f5b-7704-4834-8f59-5e138b6a784b
https://github.com/adrielcafe/voyager/assets/528792/034bae4e-dbc9-42fb-ab4d-426a8a5f8fe6
This only happens when the DynamicMaterialTheme
sits outside of the Navigator
composable.
I have tried both Voyager 1.0.0
and 1.1.0-alpha04
, both experience the issue.
I will try to debug hit here soon. But based on that fact that Android works and iOS does not, it seems to be a Compose KMP issue on iOS.
I have the same problem. Have you solved it?
Hey people, it seems to be a Compose Multiplatform issue, we are looking into it.
This appears to be a problem with the Compose Runtime, when using the single-argument CompositionLocalProvider
with providesDefault
.
Until it's fixed, you can use
CompositionLocalProvider(values = arrayOf(MyLocal providesDefault myValue)) { ... }
instead of
CompositionLocalProvider(MyLocal providesDefault myValue) { ... }
Ok, so actually it has already been fixed in Compose Multiplatform 1.6.10
I have the same issue: Compose 1.6.10 Kotlin 2.0.0 Voyager 1.1.0-beta02
Affected platforms: Android, Desktop, Web
But on Voyager 1.0.0 - all working correctly