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
<Link to="." replace={false} state={newState}>
Show Modal
</Link>
Expected Behavior
With this link, I'm trying to push a new state while maintaining the current page so that the browser back button will revert the state
Actual Behavior
Clicking the link replaces the history entry instead of pushing. In other words, it ignores the replace={false} prop
In the code for useLinkClickHandler there is a comment "If the URL hasn't changed, a regular will do a replace instead of a push, so do the same here."
which makes sense, but only if the replace prop hasn't been explicitly set.
The text was updated successfully, but these errors were encountered:
What version of React Router are you using?
6.2.2
Steps to Reproduce
Construct a Link like this
Expected Behavior
With this link, I'm trying to push a new state while maintaining the current page so that the browser back button will revert the state
Actual Behavior
Clicking the link replaces the history entry instead of pushing. In other words, it ignores the
replace={false}
propIn the code for useLinkClickHandler there is a comment "If the URL hasn't changed, a regular will do a replace instead of a push, so do the same here."
which makes sense, but only if the replace prop hasn't been explicitly set.
The text was updated successfully, but these errors were encountered: