useParams typescript error
I have some shared components that i use across different routers. I wanna use useParams hook but sometimes params is not on URL and passed to component like a param. In this cases i got TS error:
example:
error: /fileName.tsx(45,35): error TS2339: Property 'someId' does not exist on type '{}'.
error: /fileName.tsx(45,35): error TS2339: Property 'someId' does not exist on type '{}'.
1 Reply
compatible-crimson•13mo ago
can you please provide a minimal complete example by forking one of the existing examples on stackblitz?