Skip to content

Replace providesDefault in Navigator with provides and an if check#500

Open
hristogochev wants to merge 1 commit into
adrielcafe:mainfrom
hristogochev:replace-providesDefault-in-navigator-with-provides-and-an-if-check
Open

Replace providesDefault in Navigator with provides and an if check#500
hristogochev wants to merge 1 commit into
adrielcafe:mainfrom
hristogochev:replace-providesDefault-in-navigator-with-provides-and-an-if-check

Conversation

@hristogochev
Copy link
Copy Markdown

This is a workaround for an issue with Compose Multiplatform which prevents theme and system padding updates from happening inside nested navigators.

Fixes #484, #486 and #489.

@DevSrSouza
Copy link
Copy Markdown
Collaborator

It seems it was fixed and published at Google Jetpack compose androidx.compose.runtime:runtime:1.8.0-alpha06, we can wait until we have a Compose KMP version before seeing if this requires to be merge or suggested to just update Compose.

https://issuetracker.google.com/u/0/issues/374263387

@hristogochev
Copy link
Copy Markdown
Author

hristogochev commented Nov 14, 2024

Sure, we can wait for the fix to reach Compose Multiplatform instead!

Given that Compose Multiplatform was only released 2 days ago and the usual release cycle for a new major release is around 3-4 months, I think it will take at least 3 months until a release with these fixes is published.
Until then developers can use a fork of Voyager with this pull request to solve the linked issues.

blackbbc added a commit to blackbbc/voyager that referenced this pull request Apr 21, 2026
Workaround for CMP-6891: using `providesDefault` for LocalNavigatorStateHolder
blocks inherited outer CompositionLocal updates from reaching the Navigator
subtree. Symptoms seen on ovCompose / Compose Multiplatform pre-1.8.0-alpha06:
theme changes do not propagate below Navigator, causing stale colors in all
screens until the app is restarted.

Backport of adrielcafe#500 — change LocalNavigatorStateHolder to a
nullable static local and only provide it when absent, instead of using
providesDefault.

Refs:
- https://youtrack.jetbrains.com/issue/CMP-6891
- adrielcafe#500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System WindowInsets Not Consumed on iOS Targets When using Nested Navigators

2 participants