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 fetchedisLoading
: 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.