In my Next.js application, I'm using a router hook and destructuring like this:
const {
query: { run_id },
} = useRouter();
The type of `run_id` is as follows:
run_id: string | string[] | undefined
I tried to typecast it as shown below, but it doesn't seem to work. Can someone help me figure out what's missing?
const {
query: { run_id as string},
} = useRouter();