-
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: 4 comments 13 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.
-
It might be worth noting that one of the official examples in the docs is throwing this error: The example seems fairly innocent. I'm unable to tell what might be wrong. The stack trace seems to mention the hydration boundary, but nothing more than that. |
Beta Was this translation helpful? Give feedback.
this should work. please provide a codesandbox reproduction showing the issue, thanks.