ilc-adapter-react
Version:
A single spa plugin for React apps
22 lines (21 loc) • 748 B
TypeScript
import * as React from 'react';
import { ErrorInfo, ReactNode } from 'react';
import { ErrorHandler } from 'ilc-sdk/app';
interface ErrorState {
caughtError?: Error;
caughtErrorInfo?: ErrorInfo;
}
interface Props {
onError: ErrorHandler;
errorBoundary?: (error: Error, errorInfo?: ErrorInfo) => ReactNode;
children?: React.ReactNode;
}
export default class AdapterErrorBoundary extends React.Component<Props, ErrorState> {
constructor(props: Props);
static getDerivedStateFromError(error: Error): {
caughtError: Error;
};
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
}
export {};