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

Changing URL without rerender #2335

Closed
adamscybot opened this issue Oct 21, 2015 · 4 comments
Closed

Changing URL without rerender #2335

adamscybot opened this issue Oct 21, 2015 · 4 comments

Comments

@adamscybot
Copy link

With the new history.pushState API, how can I transition to a URL without triggering a rerender? I.e. a silent change to the URL. I found various resources on how to do this online, but all were for old versions.

@knowbody
Copy link
Contributor

what do you mean by "silent change to the URL"? when you change the URL you are mounting/rendering a new component.

@knowbody
Copy link
Contributor

@adamscybot please describe what you are trying to do (what is your use case)

@adamscybot
Copy link
Author

This details it better:

http://stackoverflow.com/questions/26239154/react-router-update-url-hash-without-re-rendering-page

However, the answer for 1.0 is no longer relevant due to the new history module I believe...

@taion
Copy link
Contributor

taion commented Oct 22, 2015

Why do you need to prevent a re-render for that sort of use case? Route changes don't trigger components to unmount if the component itself doesn't change. For something like the carousel example I'd actually just use the route (or an attached store w/e.g. redux-router) as my source of truth.

@remix-run remix-run deleted a comment from Demven Jan 9, 2018
@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

No branches or pull requests

3 participants