Still trying to wrap my head around typescript.
I'm trying to type a destructured object like so:
const { authError }: {authError: string} = useRouterQuery()
authError must be a string to work well with other components, but useRouterQuery() is using a different type: ParsedUrlQuery.
So I'm getting the following typescript error: Property 'authError' is missing in type 'ParsedUrlQuery' but required in type '{ authError: string; }'.
Hoping someone can explain the cleanest solution for this.
EDIT: ParsedUrlQuery type returns:
type ParsedUrlQuery = {
[x: string]: string | string[] | undefined;
}