-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
provided HashRouter with own createHref implementation #4024
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some tests? Thanks!
Can't we just send along the prop given to |
The issue here is not the url which is pushed to history, that works fine. It's the It fixes browser behaviour such as right-click -> open in new tab, which before would take you to the wrong url. |
LGTM. Thanks for the tests! |
https://github.com/ReactTraining/react-history/blob/master/modules/HashHistory.js#L19-L21 Looks like we need cases for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide cases for hashbang, noslash, and slash
I imported two functions from the history/PathUtils : I don't know if this is the best solution since the LocationUtils.js imports two functions from react-history/PathUtils which itself just exports Perhaps we can also add the two methods to I hope that makes sense somehow ... |
I think what you did makes sense, we know history is always going to be a dependency. Looks good to me now 👍 |
history is fine, I'm actually killing react-history this week. |
Thanks @herrkris 🏆 |
I added an extra function since the link looks different when using
hashType
hashbang
.This is a fix for #4022. I hope I'm doing it the right way, since this is more or less my first PR.
Help appreciated, especially if it needs tests :)