Components

ErrorBoundary

v1.0.0

React error boundary with optional fallback UI to isolate rendering failures.

Import

import { ErrorBoundary } from '@meteorack/sdk-react';

How To Use It

  • Wrap risky widgets or page regions so one rendering failure does not break the rest of the admin interface.
  • Use a focused fallback that explains the failed area instead of swallowing errors silently.

Works Well With

Props

children: ReactNode

Protected content to render inside the boundary.

fallback?: ReactNode

Optional fallback UI when a descendant throws.

Example

ErrorBoundary.tsx
import { ErrorBoundary, Card } from '@meteorack/sdk-react';

function RiskyWidget() {
  throw new Error('Malformed payload');
}

export function SafeWidget() {
  return (
    <ErrorBoundary fallback={<Card>Widget failed to render.</Card>}>
      <RiskyWidget />
    </ErrorBoundary>
  );
}