@flatbiz/antd
Version:
34 lines (31 loc) • 863 B
TypeScript
import { TNoopDefine } from '@flatbiz/utils';
import { Component, ReactNode } from 'react';
export interface ErrorBoundaryProps {
message?: ReactNode;
description?: ReactNode;
children?: ReactNode;
onRenderReset?: TNoopDefine;
/** 栈消息最大高度,默认值200 */
stackMaxHeight?: number | "auto";
}
export interface ErrorBoundaryStates {
error?: Error | null;
info?: {
componentStack?: string;
};
}
declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryStates> {
state: {
error: undefined;
info: {
componentStack: string;
};
};
componentDidCatch(error: Error | null, info: object): void;
render(): string | number | boolean | Iterable<ReactNode> | import("react").JSX.Element | null | undefined;
}
/**
* react 异常拦截
*/
export declare const ErrorBoundaryWrapper: typeof ErrorBoundary;
export {};