-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Describe the bug
When using useQueries() with typed individual queries, the data type is not inferred when using onSuccess or select methods, and we get an error
Parameter 'data' implicitly has an 'any' type.
With useQuery() it works fine and we can see the data's type:
(parameter) data: number
Your minimal, reproducible example
https://codesandbox.io/s/wizardly-ride-w58pio?file=/src/App.tsx
Steps to reproduce
- Go to sandbox - https://codesandbox.io/s/wizardly-ride-w58pio?file=/src/App.tsx
- Check
onSuccessinuseQuery()options, it works fine. - Check
onSuccessandselectinuseQueries()options, it has an error.
Expected behavior
It is expected to have the inferred type also in useQueries()
How often does this bug happen?
No response
Screenshots or Videos
Platform
- OS: mac OS
- Browser: Opera
react-query version
v4.0.10
TypeScript version
v4.7.4
Additional context
No response
omniphx, TkDodo, chris-f23, yashsway, asus18019 and 1 more
