react-solid-flow
Version:
[SolidJS](https://www.solidjs.com/docs/latest/api#control-flow)-inspired basic control-flow components and everyday async state hook library for [React](https://reactjs.org/)
27 lines (26 loc) • 960 B
TypeScript
import React from 'react';
import { Component } from "react";
import type { ReactNode } from "react";
interface ErrorBoundaryProps {
/** renderProp (or static content) to display if error has occured */
fallback?: ReactNode | ((err: unknown, reset: () => void) => ReactNode);
/** content to display when no error was catched */
children?: ReactNode;
/** callback to call, when an error happens */
onCatch?: (error: unknown, errorInfo: unknown) => void;
}
interface ErrorBoundaryState {
error: unknown;
}
/** General ErrorBoundary component */
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
constructor(props: ErrorBoundaryProps);
state: ErrorBoundaryState;
static getDerivedStateFromError(error: unknown): {
error: unknown;
};
componentDidCatch(error: unknown, errorInfo: unknown): void;
resetError(): void;
render(): React.ReactNode;
}
export {};