# ErrorBoundary

**Kind:** Constant

**Source:** [`src/jsx/dom/components.ts`](https://github.com/honojs/hono/blob/main/src/jsx/dom/components.ts#L7)

**Part of:** [Jsx](subsystem-src-jsx)

## Definition

```ts
FC< PropsWithChildren<{ fallback?: Child fallbackRender?: FallbackRender onError?: ErrorHandler }> >
```

## Value

```ts
(({ children, fallback, fallbackRender, onError }: any) => {
  const res = Fragment({ children })
  ;(res as any)[DOM_ERROR_HANDLER] = (err: any) => {
    if (err instanceof Promise) {
      throw err
    }
    onError?.(err)
    return fallbackRender?.(err) || fallback
  }
  return res
}) as any
```

## Relationships

- IMPORTS → `DOM_ERROR_HANDLER`

## Used by

1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (1)

- `childrenToString` — `src/jsx/components.ts`:14
