I am trying to get the id off of a route param in Vuejs. I get the error below and cant find a way to solve it.
// how I am accessing the id
const route = useRoute()
const id = route.params.id
Typescript Error:
Property 'id' does not exist on type 'Record<never, never> | { all?: string[] | undefined; } | { id: string; } | { id: string; } | { id: string; }'.
Property 'id' does not exist on type 'Record<never, never>'.ts(2339)
What I have tried:
I have tried using optional chaining and accessing the id as route.params['id']
but cant supress the error.
How can I resolve the issue.