This is simple ErrorBoundary component
import { ErrorBoundary } from "react-simple-error-boundary";
<ErrorBoundary errorComponent={YourErrorComponentHandler}>
<PageOrComponent/>
</ErrorBoundary>
import { withErrorBoundary } from "react-simple-error-boundary";
const WrappedPageOrComponent = withErrorBoundary(PageOrComponent, YourErrorComponentHandler);