zent
Version:
一套前端设计语言和基于React的实现
10 lines (9 loc) • 522 B
TypeScript
/// <reference types="react" />
import { IErrorBoundaryFallbackComponentProps, IOnErrorCallback } from './ErrorBoundary';
export interface IWithErrorBoundaryOption<P> {
Component?: React.ComponentType<P>;
FallbackComponent?: React.ComponentType<IErrorBoundaryFallbackComponentProps>;
onError?: IOnErrorCallback;
}
export declare function withErrorBoundary<P>({ Component: BaseComponent, FallbackComponent, onError, }?: IWithErrorBoundaryOption<P>): (props: P) => JSX.Element;
export default withErrorBoundary;