You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/react/guides/infinite-queries.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ When using `useInfiniteQuery`, you'll notice a few things are different:
11
11
-`data.pages` array containing the fetched pages
12
12
-`data.pageParams` array containing the page params used to fetch the pages
13
13
- The `fetchNextPage` and `fetchPreviousPage` functions are now available (`fetchNextPage` is required)
14
-
- The `defaultPageParam` option is now available (and required) to specify the initial page param
14
+
- The `initialPageParam` option is now available (and required) to specify the initial page param
15
15
- The `getNextPageParam` and `getPreviousPageParam` options are available for both determining if there is more data to load and the information to fetch it. This information is supplied as an additional parameter in the query function
16
16
- A `hasNextPage` boolean is now available and is `true` if `getNextPageParam` returns a value other than `null` or `undefined`
17
17
- A `hasPreviousPage` boolean is now available and is `true` if `getPreviousPageParam` returns a value other than `null` or `undefined`
Copy file name to clipboardExpand all lines: docs/react/guides/migrating-to-v5.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -321,18 +321,18 @@ The options you can pass to dehydrate have been simplified. Queries and Mutation
321
321
- dehydrateQueries?: boolean
322
322
```
323
323
324
-
### Infinite queries now need a `defaultPageParam`
324
+
### Infinite queries now need a `initialPageParam`
325
325
326
326
Previously, we've passed `undefined` to the `queryFn` as `pageParam`, and you could assign a default value to the `pageParam` parameter in the `queryFn` function signature. This had the drawback of storing `undefined` in the `queryCache`, which is not serializable.
327
327
328
-
Instead, you now have to pass an explicit `defaultPageParam` to the infinite query options. This will be used as the `pageParam` for the first page:
328
+
Instead, you now have to pass an explicit `initialPageParam` to the infinite query options. This will be used as the `pageParam` for the first page:
0 commit comments