T
TanStack2y ago
extended-salmon

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
foreign-sapphire
foreign-sapphire2y ago
isFetched is also true when the query errors
extended-salmon
extended-salmonOP2y 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?