Closed ccreusat closed 2 weeks ago
Maybe you need to manually import UseQueryResult
from @tanstack/react-query
:
import { useQuery } from '@tanstack/react-query'
import type { UseQueryResult } from '@tanstack/react-query'
export const useActions = (): UseQueryResult => {
// ...
}
Describe the bug
Hello !
I have a bunch of React Query v5 Queries and Mutations exported as custom hooks:
Everything worked fine in v4 but after updating in v5, I have this typescript error :
To avoid the error, I have to declare the return type as below :
For info, I'm using React Query
5.8.4
and I mentioned the issue here : https://github.com/TanStack/query/discussions/6670I used this in our ui library and it worked...
But it is not working on our app
explorer
Any help ?
Reproduction
https://github.com/opendigitaleducation/explorer/tree/dev/frontend
Steps to reproduce
System Info
Validations