Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(useInfiniteQuery): add isRefetching to returned properties docs #4567

Merged
merged 1 commit into from Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/reference/useInfiniteQuery.md
Expand Up @@ -23,7 +23,7 @@ const {

**Options**

The options for `useInfiniteQuery` are identical to the [`useQuery` hook](../reference/useQuery) with the addition of the following and a small difference in `isRefetching`:
The options for `useInfiniteQuery` are identical to the [`useQuery` hook](../reference/useQuery) with the addition of the following:

- `queryFn: (context: QueryFunctionContext) => Promise<TData>`
- **Required, but only if no default query function has been defined** [`defaultQueryFn`](../guides/default-query-function)
Expand All @@ -39,13 +39,10 @@ The options for `useInfiniteQuery` are identical to the [`useQuery` hook](../ref
- When new data is received for this query, this function receives both the first page of the infinite list of data and the full array of all pages.
- It should return a **single variable** that will be passed as the last optional parameter to your query function.
- Return `undefined` to indicate there is no previous page available.
- `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`

**Returns**

The returned properties for `useInfiniteQuery` are identical to the [`useQuery` hook](../reference/useQuery), with the addition of the following:
The returned properties for `useInfiniteQuery` are identical to the [`useQuery` hook](../reference/useQuery), with the addition of the following and a small difference in `isRefetching`:

- `data.pages: TData[]`
- Array containing all pages.
Expand All @@ -69,3 +66,6 @@ The returned properties for `useInfiniteQuery` are identical to the [`useQuery`
- This will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).
- `hasPreviousPage: boolean`
- 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`