-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
skip pushing to history when location matches link (#5362) #5363
Conversation
This is something that would have to be handled by |
@pshrmn current behavior differs from default browser one. Currently, it is unexpected and breaks navigation logic for page transitions for example. It was working correctly in React Router 3. |
I agree that the current implementation is incorrect, but I'm a bit wait and see on re-opening the PR. Is the "correct" behavior to replace instead of push or to just cancel the transition? When I was writing hickory I implemented the same API as in the above PR (although I decided I preferred the name I'm not actually sure how it worked in v3 to prevent duplicate locations from causing duplicate entries. @vladshcherbin do you know if it was history or RR that prevented re-routing to a duplicate location? |
@pshrmn when I found out duplication, I checked my old project and it's not duplicating same location. The project is using RR v3.0.2 and history v3.2.1. From the source code of that version, here is probably how this case was resolved: https://github.com/ReactTraining/history/blob/v3.2.1/modules/createHistory.js#L99 |
Alright, so v3 still emits a new location when the location is that same. I'll re-open my issue in |
@pshrmn thank you, it'll be really great to restore how it worked in v3. We are trying to create an example of page transition using RR v4 and React Transition Group v2 and current |
No description provided.