Unverified Commit e49bfeaf authored by Felipe Saldanha's avatar Felipe Saldanha Committed by GitHub

Update router.md (#47210)

parent 6aa8c376
...@@ -283,7 +283,7 @@ export default function Login() { ...@@ -283,7 +283,7 @@ export default function Login() {
useEffect(() => { useEffect(() => {
// Prefetch the dashboard page // Prefetch the dashboard page
router.prefetch('/dashboard') router.prefetch('/dashboard')
}, []) }, [router])
return ( return (
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
...@@ -331,7 +331,7 @@ export default function Page() { ...@@ -331,7 +331,7 @@ export default function Page() {
return true return true
}) })
}, []) }, [router])
return <p>Welcome to the page</p> return <p>Welcome to the page</p>
} }
...@@ -425,7 +425,7 @@ export default function MyApp({ Component, pageProps }) { ...@@ -425,7 +425,7 @@ export default function MyApp({ Component, pageProps }) {
return () => { return () => {
router.events.off('routeChangeStart', handleRouteChange) router.events.off('routeChangeStart', handleRouteChange)
} }
}, []) }, [router])
return <Component {...pageProps} /> return <Component {...pageProps} />
} }
...@@ -458,7 +458,7 @@ export default function MyApp({ Component, pageProps }) { ...@@ -458,7 +458,7 @@ export default function MyApp({ Component, pageProps }) {
return () => { return () => {
router.events.off('routeChangeError', handleRouteChangeError) router.events.off('routeChangeError', handleRouteChangeError)
} }
}, []) }, [router])
return <Component {...pageProps} /> return <Component {...pageProps} />
} }
......
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