mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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
16 lines
292 B
JavaScript
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>
|
|
</>
|
|
)
|
|
}
|