Last active
December 4, 2018 02:38
-
-
Save igordata/30c73b258f55d133c9e98bf287c0eb66 to your computer and use it in GitHub Desktop.
next.js link doesn't scroll to hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Link from 'next/link' | |
export default () => ( | |
<div> | |
<Link href="#some"><a>that one doesn't work</a></Link> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> | |
<a href="#some">this one works</a> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> | |
<a name="some"/>#some <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> | |
</div> | |
) |
<a name="some"/>#some
try to use id
instand of name
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I faced the same problem. It is sad, that Link not support #anchor