Next.js Discord

Discord Forum

how to get route query?

Answered
Mandarin fish posted this in #help-forum
Open in Discord
Mandarin fishOP
like login?id=123
Answered by B33fb0n3
@Mandarin fish you can get them by using the searchParams: https://nextjs.org/docs/app/api-reference/functions/use-search-params
View full answer

5 Replies

@Mandarin fish you can get them by using the searchParams: https://nextjs.org/docs/app/api-reference/functions/use-search-params
Answer
Northern Inuit Dog
May I know you're a newbie or a pro developer? and which version of nextjs you're using? you can handle solve thing using dynamic routes.
@B33fb0n3 <@1055859935000416367> you can get them by using the searchParams: https://nextjs.org/docs/app/api-reference/functions/use-search-params
Mandarin fishOP
thanks, I've read about just the query, but I didn't pay attention to this one.