React Query: isLoading vs isFetching vs isRefetching
24 January 2023 (Updated 25 January 2023)
On this page
isLoading
or `status === ‘loading’`
Is true
when the query has no data yet and is fetching for the first time.
isFetching
Is true
whenever a request is in-flight – includes the initial request and subsequent refetches.
isRefetching
Is true
whenever a request is in-flight, but doesn’t include the initial request. Equivalent to isFetching && !isLoading
.
Sources
Tagged:
React Query
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment