Replies: 5 comments 6 replies
|
We've clarified here why this change was made:
yep, we tried that, but it's harder to do than it looks :) |
6 replies
|
this is dumb |
0 replies
|
this is dumb |
0 replies
|
I am facing the same issue |
0 replies
|
This is dumb af. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
All reactions