API.md

@lazarv/react-server/error-boundary

この API リファレンスはまだ翻訳されていません。以下は英語版の内容です。

Error boundary primitives for server components: catch rendering errors, render fallbacks, and surface error info to your observability stack.

type ErrorBoundaryComponentProps = React.PropsWithChildren<{ error: Error & { digest?: string; }; resetErrorBoundary: () => void; }>;
type ErrorBoundaryPropsWithComponent = ErrorBoundarySharedProps & { fallback?: never; FallbackComponent: ComponentType<FallbackProps>; fallbackRender?: never; };
type ErrorBoundaryPropsWithFallback = ErrorBoundarySharedProps & { fallback: ReactElement<unknown, string | FunctionComponent | typeof Component> | null; FallbackComponent?: never; fallbackRender?: never; };
type ErrorBoundaryPropsWithRender = ErrorBoundarySharedProps & { fallback?: never; FallbackComponent?: never; fallbackRender: typeof FallbackRender; };
type FallbackProps = { error: any; resetErrorBoundary: (...args: any[]) => void; };
type ReactServerErrorBoundaryProps = React.PropsWithChildren<Omit<ErrorBoundaryProps, "fallback"> & { fallback?: React.ReactNode; component?: React.ComponentType<ErrorBoundaryComponentProps> | React.ReactNode; }>;