From eeeeb814b6b31f6c755230d3a5f3a4751cec607e Mon Sep 17 00:00:00 2001 From: Abdullah Mzaien Date: Tue, 16 Mar 2021 09:16:38 +0300 Subject: [PATCH 1/2] Duplicate scroll descritption - `scroll` - Optional boolean, controls scrolling to the top of the page after navigation. Defaults to `true` and - `scroll`: Scroll to the top of the page after a navigation. Defaults to `true` as options for router.push --- docs/api-reference/next/router.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-reference/next/router.md b/docs/api-reference/next/router.md index 143b4342064a1..582a83c34dcd3 100644 --- a/docs/api-reference/next/router.md +++ b/docs/api-reference/next/router.md @@ -72,9 +72,9 @@ router.push(url, as, options) - `url` - The URL to navigate to - `as` - Optional decorator for the URL that will be shown in the browser. Before Next.js 9.5.3 this was used for dynamic routes, check our [previous docs](https://nextjs.org/docs/tag/v9.5.2/api-reference/next/link#dynamic-routes) to see how it worked - `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 of the page after 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` + > 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. From 0289fcce3ca2548a6ba16bd59acf91ef714e3d3c Mon Sep 17 00:00:00 2001 From: Luis Alvarez Date: Tue, 16 Mar 2021 10:32:58 -0600 Subject: [PATCH 2/2] lint fix --- docs/api-reference/next/router.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api-reference/next/router.md b/docs/api-reference/next/router.md index 582a83c34dcd3..8467607594fe9 100644 --- a/docs/api-reference/next/router.md +++ b/docs/api-reference/next/router.md @@ -75,7 +75,6 @@ router.push(url, as, options) - `scroll` - Optional boolean, controls scrolling to the top of the page after 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` - > 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. #### Usage