Capítulo 71 de 80
The Suspense variant of useQueries — the fix for the "multiple useSuspenseQuery calls in one component run serially" pitfall, since suspending components can't run more than one query's suspend/resume cycle side by side any other way.
useSuspenseQuery calls placed side by side in one component suspend on the first one before the others even start, turning what looks like parallel data-fetching into a serial waterfall — useSuspenseQueries({ queries: [...] }) fetches the whole array in parallel under Suspense instead.{ queries: [...] } array-of-options shape as useQueries.select typing limitation: identical to useQueries — an inline select on a query object can't infer from that object's own queryFn; use an explicit annotation or queryOptions().const [usersQuery, teamsQuery, projectsQuery] = useSuspenseQueries({
queries: [
{ queryKey: ['users'], queryFn: fetchUsers },
{ queryKey: ['teams'], queryFn: fetchTeams },
{ queryKey: ['projects'], queryFn: fetchProjects },
],
})
useSuspenseQuery calls that would otherwise serialize.useSuspenseQuery (or more) appears in one component, switch all of them to one useSuspenseQueries call — this is the primary reason the hook exists.combine option and select typing caveat.