-
Notifications
You must be signed in to change notification settings - Fork 41
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
Made old StateContext values Idempotent #257
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On Mobile and Native, the navigation was only idempotent for the next and previous state and data but not for the old state and data. It was ok to double tapping because it wouldn't change the crumb trail. But double tapping would change the old state. For example, a double tap a link that navigates A --> B. The first tap the old State is A. The second tap the old State is B because it took the old State from the top level context. Instead, taken the context from the async state navigator not the top level state navigator. That way the old State is always A because the async state navigator stays the same for scene A
Built link from 'old' state navigator and passed it to current one passing in the old context
Built link from 'old' state navigator and passed it to current one passing in the old context
Built link from 'old' state navigator and passed it to current one passing in the old context
Built link from 'old' state navigator and passed it to current one passing in the old context
It's possible the url could be match but the context might've changed, e.g., naivgate A --> B then do a paused navigation to C and before it returns navigate to D and back to B. When C returns it's still at B but it shouldn't resume because it was superceded by D. The context is now updated immutably so context only changed if navigation has happened.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a bug with shared elements on Navigation React Mobile. In the 'zoom' example, double tapping the x button stopped the shared element animation. On the first tap the
oldState
is 'color' State, but on the second tap theoldState
becomes 'colors'. When theoldState
changes the shared element animation stops. The navigation wasn't fully idempotent because the oldStateContext
values changed on multiple taps.Changed to make the navigation fully idempotent. Multiple navigation taps always results in an identical
StateContext
.