React · Junior · Question 49 of 75
How do isPending and isFetching differ in TanStack Query v5?
- 1They're synonyms: both are true while a request is in flight
- ✓Correct answer:
isPending- no data yet,isFetching- any request is in flight - 3
isPending- the request failed,isFetching- it succeeded
Explanation
isPending (status pending) means there's no data in the cache yet - show a skeleton. isFetching is true for every request, including background refetches of existing data - a small indicator fits here. In v4, isLoading was used instead of isPending.