import { useRouter } from 'next/router'; import React from 'react'; const slug = () => { const router = useRouter() const blogSlug = router.query.slug; console.log(router); return ( <> <h1 className="text-4xl">{ blogSlug } Blogpost</h1> </> ); } export default slug;
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter