You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click on Home page link many times, each click creates a new history item. Home page is re-rendered every time. Now your browser navigation is broken (back/forward buttons are not working as expected).
Expected Behavior
Clicks on <Link /> component should not add new history items when location is the same.
Default browser <a> tag doesn't create history duplicates. This bug was introduced in RR v4 with history v4, RR v3 had correct behavior.
Actual Behavior
Each click on <Link /> component adds new history item, even when location is the same.
All of this issues are ignored with an excuse that history v4 needs to fix this but until it's not fixed there it has to be fixed in react-router because it is a breaking change from RR v3, RR v4 is not following browser specs and this bug is creating a lot of problems.
The text was updated successfully, but these errors were encountered:
As stated before in the issues you linked, this is something history has to solve. We cannot and should not try to patch around it, because it will result in behavior differences between Link and history.push usage.
BTW, I'm not closing this because it's not an issue (it definitely is!), but just because this is in the wrong repo. I would keep pushing on remix-run/history#507 to solve it. A PR will be the best way, since it gives us something actionable to work with.
Version
4.2.2
Test Case
https://codesandbox.io/s/23v4l0o9l0
Steps to reproduce
Click on
Home
page link many times, each click creates a new history item. Home page is re-rendered every time. Now your browser navigation is broken (back/forward buttons are not working as expected).Expected Behavior
Clicks on
<Link />
component should not add new history items when location is the same.Default browser
<a>
tag doesn't create history duplicates. This bug was introduced in RR v4 with history v4, RR v3 had correct behavior.Actual Behavior
Each click on
<Link />
component adds new history item, even when location is the same.This creates a lot of problems, some of them:
Related issues
There are a lot of related issues, some of them:
RR #5362 #5039 #5363
History #470 #507 #472
All of this issues are ignored with an excuse that history v4 needs to fix this but until it's not fixed there it has to be fixed in react-router because it is a breaking change from RR v3, RR v4 is not following browser specs and this bug is creating a lot of problems.
The text was updated successfully, but these errors were encountered: