Skip to content

Commit 2c1d74b

Browse files
feat(useQueries): enable types in useQueries (TanStack#2634)
1 parent 2771a15 commit 2c1d74b

File tree

8 files changed

+610
-5
lines changed

8 files changed

+610
-5
lines changed

docs/src/pages/typescript.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ React Query is now written in **TypeScript** to make sure the library and your p
88
Things to keep in mind:
99

1010
- Types currently require using TypeScript v3.8 or greater
11+
- for [useQueries](./reference/useQueries.md), TypeScript v4.1 or greater is required to get the correct return type for each individual query (below v4.1 will mean the type of each returned `data` property is left as `unknown`)
1112
- Changes to types in this repository are considered **non-breaking** and are usually released as **patch** semver changes (otherwise every type enhancement would be a major version!).
1213
- It is **highly recommended that you lock your react-query package version to a specific patch release and upgrade with the expectation that types may be fixed or upgraded between any release**
1314
- The non-type-related public API of React Query still follows semver very strictly.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
"optional": true
8080
}
8181
},
82+
"typesVersions": {
83+
"<4.1": { "types/*": ["types/ts3.8/*"] }
84+
},
8285
"devDependencies": {
8386
"@babel/cli": "^7.11.6",
8487
"@babel/core": "^7.11.6",

0 commit comments

Comments
 (0)