Skip to content

Conversation

@peter-mouland
Copy link
Contributor

@peter-mouland peter-mouland commented Aug 23, 2023

related: #5897

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 },
  )),
})

@vercel
Copy link

vercel bot commented Aug 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Aug 23, 2023 1:23pm

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 23, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7e44f5b:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@peter-mouland peter-mouland changed the title fix(use-queries): fix documented examples chore(use-queries): fix documented examples Aug 23, 2023
@TkDodo TkDodo merged commit 78d473d into TanStack:beta Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants