Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/react/reference/useQueries.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ The `useQueries` hook can be used to fetch a variable number of queries:
```tsx
const ids = [1,2,3]
const results = useQueries({
queries: ids.map(id => [
queries: ids.map(id => (
{ queryKey: ['post', id], queryFn: () => fetchPost(id), staleTime: Infinity },
]),
)),
})
```

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