react-native-leader-line
Version:
React Native port of leader-line library for drawing arrow lines and connectors
34 lines • 1.29 kB
TypeScript
/**
* Native crash detection and error boundary for React Native Leader Line
* This component catches both JavaScript errors and native crashes
*/
import React, { Component, ErrorInfo, ReactNode } from "react";
interface Props {
children: ReactNode;
fallback?: ReactNode;
onError?: (error: Error, errorInfo: ErrorInfo) => void;
}
interface State {
hasError: boolean;
error?: Error;
errorInfo?: ErrorInfo;
}
export declare class NativeCrashBoundary extends Component<Props, State> {
constructor(props: Props);
static getDerivedStateFromError(error: Error): State;
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
handleRetry: () => void;
render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
}
/**
* HOC to wrap components with native crash detection
*/
export declare function withNativeCrashBoundary<P extends object>(WrappedComponent: React.ComponentType<P>, fallback?: ReactNode): (props: P) => React.JSX.Element;
/**
* Hook to safely execute SVG operations that might crash
*/
export declare function useSafeSVGExecution(): {
executeSafely: <T>(operation: () => T, fallback: T, operationName?: string) => T;
};
export {};
//# sourceMappingURL=NativeCrashBoundary.d.ts.map