UNPKG

react-exe

Version:

A powerful React component executor that renders code with external dependencies and custom styling

18 lines (17 loc) 690 B
import React from "react"; interface ErrorBoundaryProps { children: React.ReactNode; onError?: (error: Error, errorInfo: React.ErrorInfo) => void; fallback?: React.ReactNode; } interface ErrorBoundaryState { hasError: boolean; error: Error | null; } declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> { constructor(props: ErrorBoundaryProps); static getDerivedStateFromError(error: Error): ErrorBoundaryState; componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void; render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined; } export default ErrorBoundary;