Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nextjs check path in page

import { useRouter } from 'next/router'

export default function Component() {
  const router = useRouter()
  console.log( router.pathname );
 
PREVIOUS NEXT
Tagged: #nextjs #check #path #page
ADD COMMENT
Topic
Name
5+8 =