const result = useSuspenseQueries(options)
Options
The same as for useQueries, except that each query
can't have:
suspense
throwOnError
enabled
placeholderData
Returns
Same structure as useQueries, except that for each query
:
data
is guaranteed to be definedisPlaceholderData
is missingstatus
is always success
Caveats
Keep in mind that the component will only re-mount after all queries have finished loading. Hence, if a query has gone stale in the time it took for all the queries to complete, it will be fetched again at re-mount. To avoid this, make sure to set a high enough staleTime
.
Cancelation does not work.
“This course is the best way to learn how to use React Query in real-world applications.”—Tanner LinsleyCheck it out