Components
ErrorBoundary

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

PropTypeDefaultDescription
fallbackReactNode-Fallback UI to show when error occurs
onErrorfunction-Error handler function