-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Describe the bug
@tanstack/vue-query exports the type UseQueryReturnType and the function useQuery. The problem is that useQuery does not return UseQueryReturnType but instead a modified version of it. This modified version is not exported by the package. This is causing type errors for some of the hooks we've defined that wrap useQuery.
import {useQuery,UseQueryReturnType} from '@tanstack/vue-query';
const myQuery = useQuery(['key'], async () => 0);
function checkMyQuery<T>(query: UseQueryReturnType<T,unknown>){}
// this produces a type error because useQuery returns a modified version of UseQueryReturnType
// and that type is NOT exported.
checkMyQuery(myQuery);
Your minimal, reproducible example
Steps to reproduce
- Go to reproduction link
- see the type error
Expected behavior
As a user I expect useQuery to return UseQueryReturnType
How often does this bug happen?
No response
Screenshots or Videos
No response
Platform
- macOS
- n/a
- n/a
react-query version
4.17.0
TypeScript version
4.8.4
Additional context
No response