({
fallback,
children,
}: {
fallback: JSX.Element;
children: JSX.Element | JSX.Element[];
})
| 1 | export async function ErrorBoundary({ |
| 2 | fallback, |
| 3 | children, |
| 4 | }: { |
| 5 | fallback: JSX.Element; |
| 6 | children: JSX.Element | JSX.Element[]; |
| 7 | }): Promise<string> { |
| 8 | if (!Array.isArray(children)) |
| 9 | throw new Error("children isnt array (shouldnt be possible)"); |
| 10 | |
| 11 | return Promise.all(children) |
| 12 | .then((children) => <>{children}</>) |
| 13 | .catch(() => fallback); |
| 14 | } |
nothing calls this directly
no outgoing calls
no test coverage detected