Prepared Docs

Prepared Docs

⌘K

    Loading navigation…

User

  1. Primitives
  2. Error Boundary
  3. API and Development

Error Boundary

API and Development

View Source
Submit Issue

@prepared911/ui-app-components exports:

  • ErrorBoundary: class component catching render errors; requires onError; optional FallbackComponent receiving FallbackProps (error, resetError).
  • LoadingBoundary: centered loading UI for Suspense defaults.
  • dynamicImport: factory wrapping lazy(), Suspense, and ErrorBoundary for route-sized chunks.

ErrorBoundary · dynamicImport

ErrorBoundary props

Name

Type

Default

Description

onError

(error: Error) => void

—

Called when an error is caught — use for error reporting (e.g. logger.errorAndReport).

FallbackComponent

ComponentType<FallbackProps>

—

Custom component rendered when an error is caught. Defaults to an EmptyState with a "Try again" button.

Storybook

Interactive examples and edge cases for this component are in Storybook.

Interactive
Default Fallback
Custom Fallback

dynamicImport

Returns a component wrapper; pass importFn, optional LoadingComponent, ErrorFallback, and onError in options.

Import

Previous

Error Boundary / Usage

Next

Error Boundary / Accessibility

On this page

ErrorBoundary props
Storybook
dynamicImport
Import