Replies: 5 comments 5 replies
-
|
We've clarified here why this change was made:
yep, we tried that, but it's harder to do than it looks :) |
Beta Was this translation helpful? Give feedback.
-
|
this is dumb |
Beta Was this translation helpful? Give feedback.
-
|
this is dumb |
Beta Was this translation helpful? Give feedback.
-
|
I am facing the same issue |
Beta Was this translation helpful? Give feedback.
-
|
This is dumb af. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm upgrading from v3 to v4 and I get this error on tests that rely on returning
undefinedfromuseQuery."Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key ..."
Here's a link to the line of code:
query/packages/query-core/src/query.ts
Line 457 in 1614c31
And this is some code of how I was using it:
Now I've resorted to using
useQuery<ResponseType | null>instead and then usingdatalikedata ?? undefined.Also, this should make TS fail by not allowing
undefinedas a possible useQuery type, instead of throwing console errors on dev environment.What was the reason for adding this change? I couldn't find any info on why this check is necessary.
Beta Was this translation helpful? Give feedback.
All reactions