From 62a3741557c2de7dc9f2c1d5f21ff247eec83f0b Mon Sep 17 00:00:00 2001 From: Aleksei Tatuzov <86802654+LeshaTat@users.noreply.github.com> Date: Sun, 17 Sep 2023 18:16:18 +0400 Subject: [PATCH] docs(useInfiniteQuery): add warning about fetchNextPage disrupting default refetch behaviour --- docs/react/reference/useInfiniteQuery.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/react/reference/useInfiniteQuery.md b/docs/react/reference/useInfiniteQuery.md index 134d1e89c8..06aa4ebe82 100644 --- a/docs/react/reference/useInfiniteQuery.md +++ b/docs/react/reference/useInfiniteQuery.md @@ -68,4 +68,6 @@ The returned properties for `useInfiniteQuery` are identical to the [`useQuery` - This will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option). - `isRefetching: boolean` - Is `true` whenever a background refetch is in-flight, which _does not_ include initial `loading` or fetching of next or previous page - - Is the same as `isFetching && !isLoading && !isFetchingNextPage && !isFetchingPreviousPage` \ No newline at end of file + - Is the same as `isFetching && !isLoading && !isFetchingNextPage && !isFetchingPreviousPage` + +Keep in mind that imperative fetch calls, such as `fetchNextPage`, may interfere with the default refetch behaviour, resulting in outdated data. Make sure to call these functions only in response to user actions, or add conditions like `hasNextPage && !isFetching`.