hatch-surf/node_modules/next/dist/client/components/catch-error.d.ts
Riley Zhang df378d33ef
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
Merge GitHub main into Gitea repo (allow unrelated histories)
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>
2026-06-25 05:20:46 +02:00

45 lines
1.4 KiB
TypeScript

import type { ErrorInfo } from './error-boundary';
import React from 'react';
type UserProps = Record<string, any>;
/**
* `unstable_catchError` is a counterpart to `error.js` that provides a granular
* control of error boundaries at the component level. It provides the `ErrorInfo`
* including `unstable_retry` for error recovery.
*
* Pass a Component-like fallback function that receives the props and `ErrorInfo`.
* The props omit `children` intentionally as it is the "fallback" of the error and
* is not expected to render the children.
*
* This API is must be used inside the client module graph and cannot be imported
* in `server-only` environments like proxy, instrumentation, etc.
*
* @example
* ```tsx
* // CustomErrorBoundary.tsx
* 'use client'
* import { unstable_catchError, type ErrorInfo } from 'next/error'
*
* function CustomErrorBoundary(props: Props, errorInfo: ErrorInfo) {
* return ...
* }
*
* export default unstable_catchError(CustomErrorBoundary)
*
* // page.tsx
* 'use client'
* import CustomErrorBoundary from './CustomErrorBoundary'
*
* export default function Page() {
* return (
* <CustomErrorBoundary>
* ...
* </CustomErrorBoundary>
* )
* }
* ```
*/
export declare function unstable_catchError<P extends UserProps>(fallback: (props: P, errorInfo: ErrorInfo) => React.ReactNode): React.ComponentType<P & {
children?: React.ReactNode;
}>;
export {};