You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
microsoft/TypeScript#39081, which ships in Typescript 4.0, stops using
binding patterns as contextual types for return type inference.
react-router's `useParams` relied on this to fill in an object with
`any`s in case a binding pattern was used but no type argument was
provided. This no longer works.
This fix just adds a type argument to the tests.
For two other, more complete fixes, see
microsoft/TypeScript#39081 (comment)
Briefly, the options are (1) go back to returning `any`-filled object
types or (2) tries to default to `string`.
The second fix is probably the right one, but it may hurt
compilation/IDE performance, so I'll leave it to the package owners to
decide whether to make that change.
0 commit comments