UNPKG

@papernote/ui

Version:

A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive

22 lines 1.2 kB
import { Component, ReactNode, ErrorInfo } from 'react'; export interface ErrorBoundaryProps { children: ReactNode; fallback?: ReactNode | ((error: Error, errorInfo: ErrorInfo, reset: () => void) => ReactNode); onError?: (error: Error, errorInfo: ErrorInfo) => void; resetKeys?: Array<string | number>; } interface ErrorBoundaryState { hasError: boolean; error: Error | null; errorInfo: ErrorInfo | null; } export default class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> { constructor(props: ErrorBoundaryProps); static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>; componentDidCatch(error: Error, errorInfo: ErrorInfo): void; componentDidUpdate(prevProps: ErrorBoundaryProps): void; reset: () => void; render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined; } export {}; //# sourceMappingURL=ErrorBoundary.d.ts.map