Skip to content

can i use useQuery inside useQueries? #7444

Answered by TkDodo
Lirrrx asked this question in Q&A
Discussion options

You must be logged in to vote

no, you want queryOptions:

const optionsOne = queryOptions({ ... })
const optionsTwo = queryOptions({ ... })

then use it with:

const one = useQuery(optionsOne)
const two = useQuery(optionsTwo)
const both = useQueries({ queries: [optionsOne, optionsTwo] })

https://tkdodo.eu/blog/the-query-options-api

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Lirrrx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants