-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Describe the bug
When I transform data with the query data selector like stated here https://react-query.tanstack.com/guides/migrating-to-react-query-3#query-data-selectors a typescript error is thrown and the type in onSuccess does not change to the type returned in the select function.
To Reproduce
Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/tannerlinsley-react-query-basic-typescript-forked-j8qro?file=/src/index.tsx
- Click on 'src/index.tsx'
- Scroll down to line 34, hover the error and data in line 31
- See error & wrong type
Expected behavior
I expect that the return type of the select function might differ from the original type of the data and the type of the query data, the parameter for onSuccess etc. is overwritten by the type returned from the select function.
Additional context
Sandbox is forked from official TS example
Metadata
Metadata
Assignees
Labels
No labels