Skip to content

Commit 4aed54e

Browse files
authored
docs: update useInfiniteQuery (TanStack#1746)
1 parent 10629eb commit 4aed54e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/src/pages/reference/useInfiniteQuery.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ const {
2424
The options for `useInfiniteQuery` are identical to the [`useQuery` hook](/reference/useQuery) with the addition of the following:
2525

2626
- `queryFn: (context: QueryFunctionContext) => Promise<TData>`
27-
- **Required, but only if no default query function has been defined**
27+
- **Required, but only if no default query function has been defined** [`defaultQueryFn`](/guides/default-query-function)
2828
- The function that the query will use to request data.
2929
- Receives a `QueryFunctionContext` object with the following variables:
3030
- `queryKey: QueryKey`
3131
- `pageParam: unknown | undefined`
3232
- Must return a promise that will either resolves data or throws an error.
33+
- Make sure you return the data *and* the `pageParam` if needed for use in the props below.
3334
- `getNextPageParam: (lastPage, allPages) => unknown | undefined`
3435
- When new data is received for this query, this function receives both the last page of the infinite list of data and the full array of all pages.
3536
- It should return a **single variable** that will be passed as the last optional parameter to your query function.

0 commit comments

Comments
 (0)