Multiple Queries #764
-
How do I run multiple queries at once using useQuery hooks....? i have 3 requests, I want to run them at once |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 11 replies
-
could you be more specific? or perhaps provide an example of what you have so far? |
Beta Was this translation helpful? Give feedback.
-
You can just call multiple hooks and namespace the output
This has worked pretty well for me in a few projects so far. It feels straigtforward and maintainable.
Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
v3 has a |
Beta Was this translation helpful? Give feedback.
-
Is there a way to do this dynamically? (non version 3). I have an array of items that should be used to make calls by their id. |
Beta Was this translation helpful? Give feedback.
v3 has a
useQueries
hook: https://react-query-beta.tanstack.com/guides/migrating-to-react-query-3#usequeries