Skip to content

Commit 6ee897c

Browse files
docs(useInfiniteQuery): Correction of two mistakes in the code sample (TanStack#2064)
1 parent eb94ef3 commit 6ee897c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/pages/guides/infinite-queries.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ Manually removing a single value from an individual page:
160160
```js
161161
const newPagesArray = []
162162
oldPagesArray?.pages.forEach(page => {
163-
const newData = page.data.filter(val => val.id !== updatedId)
164-
newPagesArray.push({ data: newData, pageParam: page.pageParam })
163+
const newData = page.filter(val => val.id !== updatedId)
164+
newPagesArray.push(newData)
165165
})
166166
queryClient.setQueryData('projects', data => ({
167167
pages: newPagesArray,

0 commit comments

Comments
 (0)