Skip to content

[v5] useQueries documentation #5897

@peter-mouland

Description

@peter-mouland

Describe the bug

** Documentation error (not production bug**

useQueries code example has [ ] instead of ( )

replace

const ids = [1,2,3]
const results = useQueries({
  queries: ids.map(id => [
    { queryKey: ['post', id], queryFn: () => fetchPost(id), staleTime: Infinity },
  ]),
})

with

const ids = [1,2,3]
const results = useQueries({
  queries: ids.map(id => (
    { queryKey: ['post', id], queryFn: () => fetchPost(id), staleTime: Infinity },
  )),
})

Your minimal, reproducible example

online

Steps to reproduce

  1. goto https://tanstack.com/query/v5/docs/react/reference/useQueries

Expected behavior

()

How often does this bug happen?

Every time

Screenshots or Videos

n/a

Platform

web

Tanstack Query adapter

react-query

TanStack Query version

v5

TypeScript version

v4

Additional context

I'm happy to submit a PR if one hasn't been submitted already

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions