Skip to content

Commit

Permalink
Fix: Updated documentation about shallow routing: 2nd parameter canno…
Browse files Browse the repository at this point in the history
…t be null - only undefined
  • Loading branch information
gndelia committed Apr 14, 2020
1 parent ffa4089 commit 09679f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/routing/shallow-routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function Page() {

useEffect(() => {
// Always do navigations after the first render
router.push('/?counter=10', null, { shallow: true })
router.push('/?counter=10', undefined, { shallow: true })
}, [])

useEffect(() => {
Expand All @@ -43,7 +43,7 @@ If you don't need to add the router object to the page, you can also use the [Ro
```jsx
import Router from 'next/router'
// 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.
Expand Down

0 comments on commit 09679f5

Please sign in to comment.