Replies: 1 comment
-
it’s not recommended to do that because it is quite advanced on the TypeScript side. My recommendation is to use queryOptions as an abstraction and just pass that to useQuery: https://tkdodo.eu/blog/the-query-options-api |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all.
I created myCustom useQuery function
Options extended.
But i dont understand how i can do that with Typescript.
By default useQuery has 3 overload. And if i try to set types from original useQuery i got
error No overload matches.
What types i must to use
Help me somebody please.
Thanks
For example
import useQuery from "use query"
export function useQueryCustom(options,queryClient){
const query = useQuery(options,queryClient);
const {isError}= query;
//some custom hook which depends on queryResult
return query;
}
Beta Was this translation helpful? Give feedback.
All reactions