Error Boundary
The Error Boundary component provides you with error handling and fallback UI for your application.
Live Examples
Note: Storybook examples for ErrorBoundary component are not yet available. The component is fully functional and can be imported from @nostromo/ui-core.
Code Examples
import { ErrorBoundary } from '@nostromo/ui-core'
export default function ErrorBoundaryExample() {
return (
<ErrorBoundary fallback={<div>Something went wrong!</div>}>
<YourComponent />
</ErrorBoundary>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
fallback | ReactNode | - | Fallback UI to show when error occurs |
onError | function | - | Error handler function |