Skip to content

Commit

Permalink
Update router.md (#21899)
Browse files Browse the repository at this point in the history
include scroll option documentation for router.push
  • Loading branch information
melono6 authored Mar 8, 2021
1 parent 42b3b16 commit 81b0525
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/api-reference/next/router.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ router.push(url, as, options)
- `options` - Optional object with the following configuration options:
- `scroll`: Scroll to the top of the page after a navigation. Defaults to `true`
- [`shallow`](/docs/routing/shallow-routing.md): Update the path of the current page without rerunning [`getStaticProps`](/docs/basic-features/data-fetching.md#getstaticprops-static-generation), [`getServerSideProps`](/docs/basic-features/data-fetching.md#getserversideprops-server-side-rendering) or [`getInitialProps`](/docs/api-reference/data-fetching/getInitialProps.md). Defaults to `false`
- `scroll` - Optional boolean, controls scrolling to the top the page afer navigation. Defaults to `true`

> You don't need to use `router.push` for external URLs. [window.location](https://developer.mozilla.org/en-US/docs/Web/API/Window/location) is better suited for those cases.
Expand Down

0 comments on commit 81b0525

Please sign in to comment.