Skip to content

Commit 520f421

Browse files
authored
docs(useInfiniteQuery): add warning about fetchNextPage disrupting default refetch behaviour (#6024)
1 parent bbcdaa2 commit 520f421

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/react/reference/useInfiniteQuery.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,6 @@ The returned properties for `useInfiniteQuery` are identical to the [`useQuery`
6868
- This will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).
6969
- `isRefetching: boolean`
7070
- Is `true` whenever a background refetch is in-flight, which _does not_ include initial `loading` or fetching of next or previous page
71-
- Is the same as `isFetching && !isLoading && !isFetchingNextPage && !isFetchingPreviousPage`
71+
- Is the same as `isFetching && !isLoading && !isFetchingNextPage && !isFetchingPreviousPage`
72+
73+
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`.

0 commit comments

Comments
 (0)