Components (JSX)

Errored

Catches uncaught errors inside its subtree and renders fallback content instead. The fallback prop can be a JSX element, or a callback that receives the error and a reset() function for retry affordances.

Errors thrown from the fallback itself can be caught by a parent <Errored>.


Import

import { Errored } from "solid-js";

Type signature

function Errored(props: {
fallback:
| SolidElement
| ((err: ErrorAccessor, reset: () => void) => SolidElement);
children: SolidElement;
}): SolidElement;

Examples

<Errored
fallback={(err, reset) => (
<div onClick={reset}>Error: {err().toString()}</div>
)}
>
<MyComp />
</Errored>
Last updated: 7/4/26, 6:21 PMEdit this pageReport an issue with this page