1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Update readme.md (#3957)

Update readme for scroll props related to #3950
This commit is contained in:
Jimmy Moon 2018-03-07 16:38:11 +09:00 committed by Tim Neutkens
parent dac6e9c17d
commit 84493a67b3

View file

@ -429,6 +429,15 @@ export default ({ href, name }) =>
</Link>
```
##### Disabling the scroll changes to top on page
The default behaviour of `<Link>` is to scroll to the top of the page. When there is a hash defined it will scroll to the specific id, just like a normal `<a>` tag. To prevent scrolling to the top / hash `scroll={false}` can be added to `<Link>`:
```jsx
<Link scroll={false} href="/?counter=10"><a>Disables scrolling</a></Link>
<Link href="/?counter=10"><a>Changes with scrolling to top</a></Link>
```
#### Imperatively
<p><details>