Get complete URL with Params client-side
Unanswered
Welsh Sheepdog posted this in #help-forum
Welsh SheepdogOP
In next 12 I used to be able to get the full url including all paeans client side eg
This doesn’t seem to work anymore with the new router and I am confused as to how I can make this work, checked the docs but I can’t find anything?
example.com/folder/page?param1=124¶m2=123This doesn’t seem to work anymore with the new router and I am confused as to how I can make this work, checked the docs but I can’t find anything?
2 Replies
Welsh SheepdogOP
Nobody?
You have to conpose it yourself with
See: https://nextjs.org/docs/app/api-reference/functions/use-router#migrating-from-nextrouter
usePathname and useSearchParams.See: https://nextjs.org/docs/app/api-reference/functions/use-router#migrating-from-nextrouter