Infer TError useQuery based on the queryFn return type
I am fetching some data in React with useQuery from tanstack. This hook returns UseQueryResult<TData, TError> and tanstack nicely infers TData from the queryFn making the fetch, but I can’t make Typescript infer TError from the same function.
react-query: Types of property ‘isSuccess’ are incompatible
i have a code like this: