puzzles9351
useQuery with query params
Hi, I'm wondering how to correctly handle query params as a useQuery input using Nextjs.
Since
useRouter.query
returns undefined on first render, I need to parse the query.
This works, however there's still a type error on the query.data?.id
, since it could be null, and the query expects a string.
What is the right way to handle a situation like this.4 replies