Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Resolved conflicts by taking GitHub versions for: - .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml Kept deploy.sh updated to: - Pull from GitHub (primary source) - Push to Gitea (push-mirror) - Build from site/ directory (GitHub structure) Co-Authored-By: Paperclip <noreply@paperclip.ing>
47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
import React, { type JSX } from 'react';
|
|
import { type AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime';
|
|
export type ErrorInfo = {
|
|
error: Error;
|
|
reset: () => void;
|
|
unstable_retry: () => void;
|
|
};
|
|
export type ErrorComponent = React.ComponentType<ErrorInfo>;
|
|
export interface ErrorBoundaryProps {
|
|
children?: React.ReactNode;
|
|
errorComponent: ErrorComponent | undefined;
|
|
errorStyles?: React.ReactNode | undefined;
|
|
errorScripts?: React.ReactNode | undefined;
|
|
}
|
|
interface ErrorBoundaryHandlerProps extends ErrorBoundaryProps {
|
|
pathname: string | null;
|
|
errorComponent: ErrorComponent;
|
|
}
|
|
interface ErrorBoundaryHandlerState {
|
|
error: Error | null;
|
|
previousPathname: string | null;
|
|
}
|
|
export declare class ErrorBoundaryHandler extends React.Component<ErrorBoundaryHandlerProps, ErrorBoundaryHandlerState> {
|
|
static contextType: React.Context<AppRouterInstance | null>;
|
|
context: AppRouterInstance | null;
|
|
constructor(props: ErrorBoundaryHandlerProps);
|
|
static getDerivedStateFromError(error: Error): {
|
|
error: Error;
|
|
};
|
|
static getDerivedStateFromProps(props: ErrorBoundaryHandlerProps, state: ErrorBoundaryHandlerState): ErrorBoundaryHandlerState | null;
|
|
reset: () => void;
|
|
unstable_retry: () => void;
|
|
render(): React.ReactNode;
|
|
}
|
|
/**
|
|
* 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, errorScripts, children, }: ErrorBoundaryProps & {
|
|
children: React.ReactNode;
|
|
}): JSX.Element;
|
|
export {};
|