From 09679f50cfe8fb87d7665f1a902524747b8a6f5f Mon Sep 17 00:00:00 2001 From: Gonzalo D'Elia Date: Tue, 14 Apr 2020 18:42:16 -0300 Subject: [PATCH] Fix: Updated documentation about shallow routing: 2nd parameter cannot be null - only undefined --- docs/routing/shallow-routing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/routing/shallow-routing.md b/docs/routing/shallow-routing.md index c9d5b5e39bc61..bd4246d8e83ff 100644 --- a/docs/routing/shallow-routing.md +++ b/docs/routing/shallow-routing.md @@ -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(() => { @@ -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.