Unverified Commit 6202a7f3 authored by Gonzalo D'Elia's avatar Gonzalo D'Elia Committed by GitHub

Fix: Update shallow routing docs (#11894)

parent 7d2ee3b0
...@@ -27,7 +27,7 @@ function Page() { ...@@ -27,7 +27,7 @@ function Page() {
useEffect(() => { useEffect(() => {
// Always do navigations after the first render // Always do navigations after the first render
router.push('/?counter=10', null, { shallow: true }) router.push('/?counter=10', undefined, { shallow: true })
}, []) }, [])
useEffect(() => { useEffect(() => {
...@@ -43,7 +43,7 @@ If you don't need to add the router object to the page, you can also use the [Ro ...@@ -43,7 +43,7 @@ If you don't need to add the router object to the page, you can also use the [Ro
```jsx ```jsx
import Router from 'next/router' import Router from 'next/router'
// Inside your page // Inside your page
Router.push('/?counter=10', null, { shallow: true }) Router.push('/?counter=10', undefined, { shallow: true })
``` ```
The URL will get updated to `/?counter=10`. and the page won't get replaced, only the state of the route is changed. The URL will get updated to `/?counter=10`. and the page won't get replaced, only the state of the route is changed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment