Constructor
new ErrorBoundary(props) → {JSX.Element}
Parameters:
Name | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
props | Object | Component props. Properties
|
Returns:
The children wrapped by the error boundary or the fallback UI.
- Type:
- JSX.
Element
Example
// Wrap any component tree with ErrorBoundary
<ErrorBoundary fallback={<CustomFallback />}>
<MyComponent />
</ErrorBoundary>