bug: React: Types for callback of trpc.useQueries
doesn't allow returning an empty array
#6188
Labels
trpc.useQueries
doesn't allow returning an empty array
#6188
Provide environment information
Describe the bug
I have a query which I just want to run in a certain condition (if another query had a non-empty result). I was trying to follow the docs (see https://trpc.io/docs/client/react/useQueries in conjunction with https://tanstack.com/query/v4/docs/framework/react/guides/dependent-queries#usequeries-dependent-query) but I could not get my code snippet to compile.
Link to reproduction
https://stackblitz.com/edit/github-qa2kdy?file=src%2Fpages%2Findex.tsx
To reproduce
Change the text in the variable
text
in line 10 of theindex.tsx
, and you'll see the error appear. To me the error only appeared after changing the text.Additional information
Here's the typescript error I get on the callback:
👨👧👦 Contributing
Funding
The text was updated successfully, but these errors were encountered: