Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recomposition issue when using nested Navigators and MaterialKolor #391

Open
jordond opened this issue Apr 11, 2024 · 5 comments
Open

Recomposition issue when using nested Navigators and MaterialKolor #391

jordond opened this issue Apr 11, 2024 · 5 comments
Labels
bug Something isn't working compose-kmp Compose KMP possible bugs recomposition

Comments

@jordond
Copy link

jordond commented Apr 11, 2024

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:

voyager-android.mov
voyager-iphone.mov

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.

@DevSrSouza
Copy link
Collaborator

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.

@DevSrSouza DevSrSouza added compose-kmp Compose KMP possible bugs bug Something isn't working recomposition labels Apr 12, 2024
@liuhongjian0316
Copy link

I have the same problem. Have you solved it?

@elijah-semyonov
Copy link

elijah-semyonov commented Apr 30, 2024

Hey people, it seems to be a Compose Multiplatform issue, we are looking into it.

@m-sasha
Copy link

m-sasha commented May 2, 2024

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) { ... }

@m-sasha
Copy link

m-sasha commented May 2, 2024

Ok, so actually it has already been fixed in Compose Multiplatform 1.6.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compose-kmp Compose KMP possible bugs recomposition
Projects
None yet
Development

No branches or pull requests

5 participants