-
Hello, I need your help:sob: I got the data by setting queryFn in queryClient with setQueryDefaults and setting only the key in useQuery from the child components. In this case, it will be good work, but the "Missing queryFn error" is being output to the console. Can't I just use the only key for useQuery? case: //... querys
queryClient.setQueryDefaults(["user"], {
queryFn: () => fetchPromise("user")
});
// ... components used
const {data} = useQuery(["user"]); // this work ! but console.error |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
this should work. please provide a codesandbox reproduction showing the issue, thanks. |
Beta Was this translation helpful? Give feedback.
-
+1 same issue |
Beta Was this translation helpful? Give feedback.
-
Experiencing the same issue in I am using the query in a container ( page level ) with the queryFn, and using it only with keys in subcomponents, The main page:
subcomponents:
|
Beta Was this translation helpful? Give feedback.
this should work. please provide a codesandbox reproduction showing the issue, thanks.