react-error-boundary
Version:
Simple reusable React error boundary component
4 lines (3 loc) • 400 B
TypeScript
import { RefAttributes, ForwardRefExoticComponent, PropsWithoutRef, ComponentType, ComponentRef, ComponentProps } from "react";
import { ErrorBoundaryProps } from "./types.js";
export declare function withErrorBoundary<T extends ComponentType<any>>(component: T, errorBoundaryProps: ErrorBoundaryProps): ForwardRefExoticComponent<PropsWithoutRef<ComponentProps<T>> & RefAttributes<ComponentRef<T>>>;