Files
old-kitabcitab-frontend/kitabcitab/node_modules/next/dist/client/components/error-boundary.d.ts
2022-12-27 12:05:56 +01:00

34 lines
1.1 KiB
TypeScript

import React from 'react';
export declare type ErrorComponent = React.ComponentType<{
error: Error;
reset: () => void;
}>;
export interface ErrorBoundaryProps {
errorComponent: ErrorComponent;
errorStyles?: React.ReactNode | undefined;
}
export declare class ErrorBoundaryHandler extends React.Component<ErrorBoundaryProps, {
error: Error | null;
}> {
constructor(props: ErrorBoundaryProps);
static getDerivedStateFromError(error: Error): {
error: Error;
};
reset: () => void;
render(): React.ReactNode;
}
export default function GlobalError({ error }: {
error: any;
}): JSX.Element;
/**
* Handles errors through `getDerivedStateFromError`.
* Renders the provided error component and provides a way to `reset` the error boundary state.
*/
/**
* Renders error boundary with the provided "errorComponent" property as the fallback.
* If no "errorComponent" property is provided it renders the children without an error boundary.
*/
export declare function ErrorBoundary({ errorComponent, errorStyles, children, }: ErrorBoundaryProps & {
children: React.ReactNode;
}): JSX.Element;