Skip to content
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

Add 'replace' property to Link (backport from RR4) #5407

Closed
wants to merge 1 commit into from
Closed

Add 'replace' property to Link (backport from RR4) #5407

wants to merge 1 commit into from

Conversation

smashercosmo
Copy link
Contributor

No description provided.

@timdorr
Copy link
Member

timdorr commented Aug 3, 2017

This has been brought up in #3763 and #2914. We are attempting to emulate the behavior of a plain <a>, which is unable to replace URLs, only push them.

@timdorr timdorr closed this Aug 3, 2017
@smashercosmo
Copy link
Contributor Author

Ok, got it, but why was it implemented for RR4?

@pshrmn
Copy link
Contributor

pshrmn commented Aug 3, 2017

@smashercosmo In History v3, if you pushed a location, but it was the same as the current location, then it would call replaceState instead of pushState. That does not currently exist in History v4, so being able to do <Link replace> allows you to manually replicate that behavior. I'm not sure if that was why it was added, but it does add that functionality.

There is this issue remix-run/history#470 (and an accompanying PR) that I had opened up about bringing back the ability for history to determine whether it should push or replace. I'm no longer particularly interested in working on that, but if someone wants to champion that and work on getting it pushed through, I'm sure it would be appreciated.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants