Use isPending, isLoading and isFetching flags with React Query

Share this video with your friends

Send Tweet

There are nuances between the three loading states provided by the useQuery hook:

  • isPending: there's no data and a query hasn't been made yet.
  • isFetching: the query is being fetched
  • isLoading: there's no data, and there's a query currently being fetched. Notice that it's a combination of the above.

In this lesson, you'll learn where you'd want to use each of these states.