译零 TransZero · TanStack Query v3 中文文档
主站

useQueries

The useQueries hook can be used to fetch a variable number of queries:

JavaScript
1const results = useQueries([2  { queryKey: ['post', 1], queryFn: fetchPost },3  { queryKey: ['post', 2], queryFn: fetchPost },4])

Options

The useQueries hook accepts an array with query option objects identical to the useQuery hook.

Returns

The useQueries hook returns an array with all the query results.