jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
22 lines (21 loc) • 612 B
TypeScript
/**
* @file ErrorBoundary
* @description 捕获发生在其子组件树任何位置的 JavaScript 错误,并打印这些错误
* @author wibetter
*/
import type { ReactNode } from 'react';
import React from 'react';
interface ErrorBoundaryProps {
customErrorMsg?: string;
fallback?: () => ReactNode;
children: any;
}
interface ErrorBoundaryStates {
hasError: boolean;
}
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryStates> {
constructor(props: any);
componentDidCatch(error: any, errorInfo: any): void;
render(): any;
}
export {};