Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

next js get current url

import { useRouter } from "next/router"
export function Component() {
    const router = useRouter()
    return <div> {router.pathname} </div>
}
 
PREVIOUS NEXT
Tagged: #js #current #url
ADD COMMENT
Topic
Name
1+3 =