usePromises()
function usePromises<T>(promises): { [P in string | number | symbol]: Awaited<T[P<P>]> };
Defined in: packages/react/src/hooks/use-promises.ts:12
Hook for using multiple promises in a component. Internally this uses React's `use` API.
Type Parameters
| Type Parameter |
|---|
T extends [] | readonly Promise<any>[] |
Parameters
| Parameter | Type | Description |
|---|---|---|
promises | T | An array of promises to resolve |
Returns
{ [P in string | number | symbol]: Awaited<T[P<P>]> }
An array of resolved promise values