import React from 'react' import { useRouter } from 'next/router' const Dynamic = () => { const router = useRouter(); const { dynamic } = router.query; return ( <div> My dynamic page slug: {dynamic} </div> ) } export default Dynamic /*And you can link to it like this:*/ <Link href="/[dynamic]" as="/dynamic-page-slug"> <a>Link to my Dynamic Page</a> </Link>

Custom routing with nextjs?

Similar Code Examples