mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
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. |
||
|---|---|---|
| .. | ||
| test | ||
| v2 | ||
| v3 | ||
| index.d.ts | ||
| tsconfig.json | ||
| tslint.json | ||