Skip to main content

@lexical/react/LexicalErrorBoundary

Type Aliases

LexicalErrorBoundaryProps

LexicalErrorBoundaryProps = object

Defined in: packages/lexical-react/src/LexicalErrorBoundary.tsx:14

Props for the LexicalErrorBoundary component.

Properties

children

children: JSX.Element

Defined in: packages/lexical-react/src/LexicalErrorBoundary.tsx:15

fallback?

optional fallback?: ReactNode

Defined in: packages/lexical-react/src/LexicalErrorBoundary.tsx:16

onError

onError: (error, info) => void

Defined in: packages/lexical-react/src/LexicalErrorBoundary.tsx:17

Parameters
error

Error

info

ErrorInfo

Returns

void

Functions

LexicalErrorBoundary()

LexicalErrorBoundary(__namedParameters): Element

Defined in: packages/lexical-react/src/LexicalErrorBoundary.tsx:60

An error boundary used by RichTextPlugin and PlainTextPlugin to isolate failures thrown while rendering decorator nodes. It renders fallback in place of the failed subtree and forwards the error (coerced to an Error) along with the React ErrorInfo to the onError callback. When fallback is omitted a small default message is shown; pass fallback={null} to render nothing.

Parameters

__namedParameters

LexicalErrorBoundaryProps

Returns

Element

The wrapped children, or the fallback if an error is caught.