import React, { ErrorInfo, ReactNode } from "react"; type ErrorBoundaryProps = { fallBackUI?: ReactNode; children?: ReactNode; }; type ErrorBoundaryState = { hasError: boolean; }; /** * Something like a try catch in React component form with some exceptions. Catches Errors and logs them to the central * logger. Prevents uncaught exceptions on the render of child components from unintentionally breaking the entire UI. * Has the added benefit of sending the errors to the Central Logger * * Note: The exceptions are that it not catch errors in Event handlers and Asynchronous code. * Note: This does not catch errors in the current component directly, only child components. See below for example * * Eg: WON'T WORK * * const ContainerComponent = ({test}:any) =>
{test.undefined.length}
* * WILL WORK: * const BrokenComponent = ({test}:any) =>
{test.undefined.length}
* const ContainerComponent = ({test}:any) => * * @see https://reactjs.org/docs/error-boundaries.html for more information on Error Boundaries */ export declare class ErrorBoundary extends React.Component { constructor(props: ErrorBoundaryProps); static getDerivedStateFromError(): { hasError: boolean; }; componentDidCatch(error: Error, errorInfo: ErrorInfo): void; render(): string | number | boolean | React.JSX.Element | Iterable | null | undefined; } export {}; //# sourceMappingURL=ErrorBoundary.d.ts.map