Skip to content

Commit 78d473d

Browse files
docs(use-queries): fix documented examples (#5902)
1 parent 13b17ee commit 78d473d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/react/reference/useQueries.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ The `useQueries` hook can be used to fetch a variable number of queries:
88
```tsx
99
const ids = [1,2,3]
1010
const results = useQueries({
11-
queries: ids.map(id => [
11+
queries: ids.map(id => (
1212
{ queryKey: ['post', id], queryFn: () => fetchPost(id), staleTime: Infinity },
13-
]),
13+
)),
1414
})
1515
```
1616

@@ -40,9 +40,9 @@ If you want to combine `data` (or other Query information) from the results into
4040
```tsx
4141
const ids = [1,2,3]
4242
const combinedQueries = useQueries({
43-
queries: ids.map(id => [
43+
queries: ids.map(id => (
4444
{ queryKey: ['post', id], queryFn: () => fetchPost(id) },
45-
]),
45+
)),
4646
combine: (results) => {
4747
return ({
4848
data: results.map(result => result.data),

0 commit comments

Comments
 (0)