import Link from 'next/link' import { useRouter } from 'next/router' function Page() { const router = useRouter() const routerObj = router.isReady ? router : { pathname: '', asPath: '' } return ( <>

Hello World


getStaticProps


getServerSideProps


dynamic page


catchall page


index getStaticProps


nested index getStaticProps

Hash Link
{router.basePath}
{routerObj.pathname}
{ throw new Error('oops heres an error') }} > click me for error

{routerObj.asPath}

Slow route

Error route

Hash change

to something else ) } export default Page