DefinitelyTyped/types/react-router
Nathan Shively-Sanders cbbbfecf45
🤖 Merge PR #45780 Fix react-router hooks test by @sandersn
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

https://github.com/microsoft/TypeScript/pull/39081#issuecomment-644393729

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.
2020-06-29 13:41:10 -07:00
..
test
v2
v3
index.d.ts
tsconfig.json
tslint.json