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) =>