Skip to content

Commit 80df0cc

Browse files
authored
Add coalesce operator to prevent undefined value
1 parent 8be3c60 commit 80df0cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Manually removing a single value from an individual page:
160160
```js
161161
const newPagesArray = oldPagesArray?.pages.map((page) =>
162162
page.filter((val) => val.id !== updatedId)
163-
)
163+
) ?? []
164164

165165
queryClient.setQueryData('projects', data => ({
166166
pages: newPagesArray,

0 commit comments

Comments
 (0)