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

[Bug][Deeplink] Navigator stack doesn't change after screens list changes #387

Open
theolm opened this issue Apr 6, 2024 · 0 comments
Open
Labels

Comments

@theolm
Copy link

theolm commented Apr 6, 2024

Issue with Deep Link Implementation

Current Behavior

When initializing the navigator using Navigator(screens = screenStack), it becomes impossible to change the list of screens using the same constructor. This issue becomes problematic for the implementation of deep links.

val screenStack by screenStackFlow.collectAsState()
Navigator(screens = screenStack) // screen list never changes even if screenStack changes

The only workaround I found was to use navigator.replaceAll to swap the entire stack at once.

// This works
val screenStack by screenStackFlow.collectAsState()
 Navigator(screens = screenStack) {
      CurrentScreen()
      it.replaceAll(screenStack)
 }

Expected Behavior

Once screenStack is a state and its content changes, the list of screens in the Navigator(screens = screenStack) composable should change accordingly, respecting the state.

Sample

The issue can be observed in this sample project

bugsample.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants