Data is still undefined even after declaring isPending and isError in React Query V5
Hello, I just recently upgraded to React Query V5 and I noticed that the behavior of
isPending
and isError
has changed.
Previously, I was able to define them as guard clauses and data
would always be defined afterwards:
Now I get the following message:
Is this behavior working as intended or am I doing something wrong?
Any help would be greatly appreciated.2 Replies
genetic-orange•2y ago
It's very likely a bug, since without destructuring I get that
data
isn't undefined after the 2 checks
(both in v4 and v5)fair-rose•2y ago
Please show a typescript playground because imo this hasn't changed between v4 and v5