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
{{ message }}
This repository was archived by the owner on Oct 26, 2018. It is now read-only.
history.push(location) is called two multiple times with the same values:
first time when the <Link> is clicked
second time when route store listener is called:
var unsubscribeStore = store.subscribe(function () {
var routing = getRouterState();
// Only trigger history update if this is a new change or the
// location has changed.
if (lastRoute.changeId !== routing.changeId || !locationsAreEqual(lastRoute, routing)) {
lastRoute = routing;
var method = routing.replace ? 'replaceState' : 'pushState';
history[method](routing.state, routing.path);
}
}
This always calls history.pushState for second time because history/router and browser window already have the new location but lastRoute still contain old path. This effectively causes two equal history entries so the browser back button works on the second click only.
The current history location and window.location should be checked before history.push to prevent duplicate history entries.
The text was updated successfully, but these errors were encountered:
history.push(location)
is called two multiple times with the same values:first time when the
<Link>
is clickedsecond time when route store listener is called:
This always calls
history.pushState
for second time because history/router and browser window already have the new location butlastRoute
still contain oldpath
. This effectively causes two equal history entries so the browser back button works on the second click only.The current history location and window.location should be checked before
history.push
to prevent duplicate history entries.The text was updated successfully, but these errors were encountered: