Files
JJ KasperandGitHub 3a9d18b549 Add isReady field on router (#20628)
Adds an `isReady` field on `next/router` specifying whether the router fields are updated client-side and ready for use. Should only be used inside of `useEffect` methods and not for conditionally rendering on the server.

Closes: https://github.com/vercel/next.js/issues/8259
Closes: https://github.com/vercel/next.js/pull/9370
2020-12-31 16:54:32 +00:00

16 lines
292 B
JavaScript

import { useRouter } from 'next/router'
export default function Page(props) {
// eslint-disable-next-line
const router = useRouter()
// console.log(router.isReady)
return (
<>
<p id="invalid">invalid page</p>
<p id="props">{JSON.stringify(props)}</p>
</>
)
}