How to access id from /articles/[id]?
Answered
Lionhead posted this in #help-forum
LionheadOP
I am trying to access the id and store it in a variable, but I am getting "NextRouter was not mounted" error, why?
Answered by Ray
use
https://nextjs.org/docs/app/api-reference/functions/use-params
useParams() hook in client componenthttps://nextjs.org/docs/app/api-reference/functions/use-params
2 Replies
Answer