import React, { Component } from 'react'; export interface ErrorBoundaryProps { /** Allow nodes to be added as child to the error boundary */ children: React.ReactNode | React.ReactNode[]; /** Allows passing in a custom error message */ errorMessage?: string; /** Render function (render props pattern) to allow Custom UI rendered on error */ render?: (errorMessage: string) => JSX.Element; /** In case of error , use the message from "error.message" if set to true */ useMessageFromError?: boolean; } interface ErrorBoundaryState { hasError: boolean; errorMessage?: string; } /** * Generic ErrorBoundary class that could be used to wrap any * component. In case the wrapped component or any of its children * throw an error, ErrorBoundary would catch it. It also exposes * render function ( render props ) that allows or custom UI to * be rendered in case of error. */ declare class ErrorBoundary extends Component { constructor(props: ErrorBoundaryProps); static getDerivedStateFromError(error: Error): { hasError: boolean; errorMessage: string; }; render(): string | number | boolean | Iterable | JSX.Element | null | undefined; } export default ErrorBoundary; //# sourceMappingURL=ErrorBoundary.d.ts.map