@umituz/react-native-exception 1.2.12 → 1.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@ import { useAppDesignTokens } from '@umituz/react-native-design-system';
|
|
|
11
11
|
interface Props {
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
fallback?: ReactNode;
|
|
14
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
interface State {
|
|
@@ -40,6 +41,11 @@ export class ErrorBoundary extends Component<Props, State> {
|
|
|
40
41
|
componentStack: errorInfo.componentStack ?? undefined,
|
|
41
42
|
screen: 'ErrorBoundary',
|
|
42
43
|
});
|
|
44
|
+
|
|
45
|
+
// Call external onError if provided
|
|
46
|
+
if (this.props.onError) {
|
|
47
|
+
this.props.onError(error, errorInfo);
|
|
48
|
+
}
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
handleReset = (): void => {
|