Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

useSuspenseQueries.md

32 lines890 Bytes

1---
2id: useSuspenseQueries
3title: useSuspenseQueries
4---
5​
6```tsx
7const result = useSuspenseQueries(options)
8```
9​
10**Options**
11​
12The same as for [useQueries](../reference/useQueries.md), except that each `query` can't have:
13​
14- `suspense`
15- `throwOnError`
16- `enabled`
17- `placeholderData`
18​
19**Returns**
20​
21Same structure as [useQueries](../reference/useQueries.md), except that for each `query`:
22​
23- `data` is guaranteed to be defined
24- `isPlaceholderData` is missing
25- `status` is always `success`
26 - the derived flags are set accordingly.
27​
28**Caveats**
29​
30Keep 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`.
31​
32[Cancellation](../guides/query-cancellation.md) does not work.