Skip to content

Commit a23bf3d

Browse files
committed
Revert to use console.error for onRecoverableError
1 parent ba1a979 commit a23bf3d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

packages/react-native-renderer/src/ReactFabric.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
getPublicRootInstance,
2323
defaultOnUncaughtError,
2424
defaultOnCaughtError,
25-
defaultOnRecoverableError,
2625
} from 'react-reconciler/src/ReactFiberReconciler';
2726

2827
import {createPortal as createPortalImpl} from 'react-reconciler/src/ReactPortal';
@@ -100,6 +99,10 @@ function nativeOnCaughtError(
10099

101100
defaultOnCaughtError(error, errorInfo);
102101
}
102+
function nativeOnRecoverableError(error: mixed): void {
103+
// eslint-disable-next-line react-internal/no-production-logging, react-internal/warning-args
104+
console.error(error);
105+
}
103106

104107
function render(
105108
element: Element<ElementType>,
@@ -125,7 +128,7 @@ function render(
125128
'',
126129
nativeOnUncaughtError,
127130
nativeOnCaughtError,
128-
defaultOnRecoverableError,
131+
nativeOnRecoverableError,
129132
null,
130133
);
131134
roots.set(containerTag, root);

packages/react-native-renderer/src/ReactNativeRenderer.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
getPublicRootInstance,
2323
defaultOnUncaughtError,
2424
defaultOnCaughtError,
25-
defaultOnRecoverableError,
2625
} from 'react-reconciler/src/ReactFiberReconciler';
2726
// TODO: direct imports like some-package/src/* are bad. Fix me.
2827
import {getStackByFiberInDevAndProd} from 'react-reconciler/src/ReactFiberComponentStack';
@@ -105,6 +104,10 @@ function nativeOnCaughtError(
105104

106105
defaultOnCaughtError(error, errorInfo);
107106
}
107+
function nativeOnRecoverableError(error: mixed): void {
108+
// eslint-disable-next-line react-internal/no-production-logging, react-internal/warning-args
109+
console.error(error);
110+
}
108111

109112
function render(
110113
element: Element<ElementType>,
@@ -129,7 +132,7 @@ function render(
129132
'',
130133
nativeOnUncaughtError,
131134
nativeOnCaughtError,
132-
defaultOnRecoverableError,
135+
nativeOnRecoverableError,
133136
null,
134137
);
135138
roots.set(containerTag, root);

0 commit comments

Comments
 (0)