-
Notifications
You must be signed in to change notification settings - Fork 960
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
don't strip the hash off of the window path #51
Conversation
👍 |
👍 This is important stuff. |
This isn't fixed in 1.11.0. Using history.pushState with a hash strips the hash. Using history.pushState with a hash and a query strips both.
|
@mjackson are you aware of this? I'm not a 100% sure but it seems like it indeed still doesn't work (using latest history combined with react-router). |
Yes, seems to not be fixed in 1.12.1. I believe the problem is here: https://github.com/rackt/history/blob/master/modules/createBrowserHistory.js#L70 ...Location is being rebuilt without the hash I'll try to put together a pull request. |
Thanks for bringing this to my attention, @jackmoore. I think @zdavis is right about where the problem is. I'll see if I can make a fix. |
I should also note that in your second example, @jackmoore, you should be sure you're using the |
@jackmoore @janpieterz @zdavis This is fixed in 7012f9b |
Fix released in 1.12.2 |
Awesome, thanks a lot for the quick effort! |
@mjackson Thanks, but when I combine the hash with query, it's putting the query in the hash. I'm using react-router's Link component if that matters, and history 1.12.2. Am I doing something wrong here?
Redirects to: |
Thanks so much! |
@jackmoore That's a slightly separate issue. Let's follow up in remix-run/react-router#2176 |
Without this change, when using
createHistory
orcreateBrowserHistory
, thewindow.location.hash
gets stripped off of the location, never to be recovered, breaking in-page navigation when using react-router.