mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Co-authored-by: Joe Haddad <[email protected]> Co-authored-by: Tim Neutkens <[email protected]>
18 lines
442 B
JavaScript
18 lines
442 B
JavaScript
import { useState, useEffect } from 'react'
|
|
import { useRouter } from 'next/router'
|
|
|
|
export default function Page() {
|
|
const [isMounted, setMounted] = useState(false)
|
|
useEffect(() => {
|
|
setMounted(true)
|
|
}, [])
|
|
const router = useRouter()
|
|
return (
|
|
<div>
|
|
{isMounted ? <div id="hydration-marker" /> : null}
|
|
<div id="page-marker">/about.js</div>
|
|
<div id="router-pathname">{router.pathname}</div>
|
|
</div>
|
|
)
|
|
}
|