Dynamic routes somewhy does not work. The code is from next.js docs.
Unanswered
Saltwater Crocodile posted this in #help-forum
Original message was deleted.
8 Replies
Original message was deleted
Try to read the error log for the router error
you are probabbly mixing up the documentation from the
you are using the
pages dir.you are using the
app folder hence you need to switch the documentation to the app routerSaltwater Crocodile
if ill do this in pages folder it should work?
Saltwater Crocodile
well it doesnt D:
thats unfortunate :(
just use the
https://nextjs.org/docs/app
app router documentation, you'll have better chance at making it workhttps://nextjs.org/docs/app
Original message was deleted
You need to import useRouter from next/navigation
But it seems usePathname or useSearchParams are more suitable for this
But it seems usePathname or useSearchParams are more suitable for this