TanStackT
TanStack2y ago
11 replies
scornful-crimson

How to use useQueries

Is this the correct way to combine two get requests with useQueries?

export const useDashboardData = (setupId, days) => {
  return useQueries({
    queries: [
      {
        queryKey: ["statsData", setupId],
        queryFn: (setupId) => fetchStatsData(setupId)
      },
      { queryKey: ["chartData", days], queryFn: (days) => fetchChartData(days) }
    ]
  });
};
Was this page helpful?