How to access isLoading if a Query is inside a component
I am having trouble in accessing isLoading from a query, the problem is that the Query is placed inside a component
2 Replies
This is where I want to use it
But I am getting isLoading is
undefined
React query does export useIsFetching, but you might also consider lifting up this query to the component above if that’s what you want to use
You can even put it in a custom hook and then call that hook at both levels with the same layoutId since react query will hit the cache the second usage