Next.js Discord

Discord Forum

router.pathname doesn't working

Answered
Mandarin fish posted this in #help-forum
Open in Discord
Mandarin fishOP
I tried to use router.pathname but it doesn't work
path:
localhost:3000/settings
Answered by Ray
use usePathname hook from next/navigation if you are using app router
View full answer

2 Replies

@Mandarin fish I tried to use router.pathname but it doesn't work path: localhost:3000/settings
use usePathname hook from next/navigation if you are using app router
Answer