import Link from 'next/link' import { useRouter } from 'next/router' import { useEffect, useState } from 'react' export default function Page(props) { const router = useRouter() const [mounted, setMounted] = useState(false) useEffect(() => { setMounted(true) }, []) return ( <>

another page

{JSON.stringify(props)}

{JSON.stringify( mounted ? { basePath: router.basePath, pathname: router.pathname, asPath: router.asPath, query: router.query, } : {} )}

to /index
to /dynamic/first
) } export function getServerSideProps() { return { props: { hello: 'world', now: Date.now(), }, } }