-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Fix <Link hash> #2216
Comments
Think I found the reason.
allowTransition is true in my case so the pushState is called, but it doesn't take hash under consideration. |
It's true in both cases, though. Are you sure you're on RC3? |
Yes, using RC3. Preventing default and doing pushState(this.props.state, this.props.to, this.props.query) seems to make Link not working with hashes. |
Good catch, @aszwemin. We really should have a test around this. Are you up for a PR? You can use the existing tests around |
Created a failing test here: master...timdorr:test-link-hash I'll get a fix together shortly. |
👍 |
I have two links, one created with
<Link to='/faq' hash='#whatis'>
and the other one created with<a href='/faq#whereq'>
that look as following when inspecting element on rendered document:When I click on the second one, hash is populated in the location object and I'm being taken to the fragment. When I click on the first one, I'm being taken to
\faq
, hash is not populated in the location object and I'm not being taken to the fragment. Any idea why is that?The text was updated successfully, but these errors were encountered: