DEV Community

Discussion on: Error: useParams Not Destructuring In Typescript

Collapse
 
fjones profile image
FJones

So in order for tsc not to crap itself about the return value, you need to tell it - in the place you're calling useParams - what it's going to return.

Is anyone gonna come up with an idiomatic way of doing this, or is it just idiotic like that? I mean, this seems to very much defeat the purpose of TS, and makes you write the same potential error twice.

Collapse
 
olaoyevick profile image
Victor Olaoye

so what do you suggest should be done to solve this error?