In my react-native project, I use tanstack react-query: https://tanstack.com/query/latest/docs/framework/solid/reference/useQuery#isrefetching-boolean
Why is isRefetching executed if I don't call refetch()? And it shows the loader in for RefreshControl
react-native: 0.79
For example at root:
const queryClient = new QueryClient();
Inside the component:
const { data, isLoading, isRefreshing, refetch} = useQuery({queryKey: ['user'], queryFn: getUser});
return (
<FlatList
data={data}
renderItem={renderItem}
keyExtractor={item => item.id}
refreshControl={<RefreshControl refreshing={isRefreshing} onRefresh={refetch} />}
/>
)
So I don't trigger a reload/pull to refresh, I just open the screen for the first time. And it always isRefreshing: true. When I go back and open the same screen again.