React Query: derived boolean flags
2 November 2023 (Updated 2 November 2023)
On this page
In a nutshell
useQuery gives you a number of derived boolean flags:
isFetching:truewhen the query is executing, whether it’s the initial fetch or subsequent background fetches.isPending:truewhen there is no cached data and no query attempt has finished yet.isLoading:truewhen the first request for a query is in-flight. Same asisFetching && isPending.isRefetching:truewhen a background refetch is in-flight. It doesn’t equaltruewhen the initial fetch is in-flight.
Sources
Tagged:
React Query
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment