import ErrorBoundary, { IErrorBoundaryFallbackComponentProps, } from './ErrorBoundary'; export interface ICatchErrorOption { onError?: (error: Error, componentStack: string) => void; FallbackComponent?: React.ComponentType; } function catchError({ FallbackComponent, onError }: ICatchErrorOption = {}) { return function catchErrorInner

(BaseComponent: React.ComponentType

) { return function CatchError(props: P) { return ( ); }; }; } export default catchError;