Query manual refetch indicator
Hey, guys!
I am using a query in react native with the Flatlist pull to refresh functionality, which requires a "refreshing" prop to indicate the data update is in progress.
I tried using the
query.isRefetching
property for that purpose, but looks like it doesn't differentiate between a manual refetch with query.refetch
and a invalidation with queryClient.invalidateQueries
.
My current workaround is creating a React ref that is updated before and after the refetch
function execution:
But I would like to know if there is a built in alternative to achieve the same behavior3 Replies
extended-salmon•2y ago
no, we don't track a reason why something is refetching+
like-goldOP•2y ago
oh.. so I think I will need to stick with the ref workaround...
unwilling-turquoise•2y ago
I'm pretty sure I use a less sketchy technique in my RN app. Works super well. Will check it and share
Actually its fairly similar just encapsulated in a hook