T
TanStack2y ago
like-gold

isFetched vs isSuccess

Can anyone explain what the difference is between isFetched and isSuccess? I have seen some other developers using these two flags to determine if data is "ready" in our application, and after reading the docs, I am not clear what the impact would be of using one vs the other.
2 Replies
graceful-blue
graceful-blue2y ago
isFetched is also true when the query errors
like-gold
like-goldOP2y ago
From what I could tell, isSuccess is more of a guarantee that the data will not be undefined (unless you explicitly return undefined from your query function). isFetched doesn't do any type narrowing.

Did you find this page helpful?