Difference isPending and the isLoading(isFetching && isPending ) in react-query @v5
Many times around my app I do something like this
this was when I was using
react-query@v4, but now I see that isLoading has been changed to isPending, but I don't know if I should change these isLoading to isPending or just leave it as is since I still have that isLoading flag that combines 2 statuses.
TL;DR: I'm having troubles understanding when and why to use isPending versus isLoading?2 Replies
automatic-azure•2y ago
isPending is fine for most use cases
isLoading is needed when a query is potentially not enabled
correct-apricotOP•2y ago
great, thanks