Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to use console.error for onRecoverableError on RN #28834

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/react-native-renderer/src/ReactFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
getPublicRootInstance,
defaultOnUncaughtError,
defaultOnCaughtError,
defaultOnRecoverableError,
} from 'react-reconciler/src/ReactFiberReconciler';

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

defaultOnCaughtError(error, errorInfo);
}
function nativeOnRecoverableError(error: mixed): void {
// eslint-disable-next-line react-internal/no-production-logging, react-internal/warning-args
console.error(error);
}

function render(
element: Element<ElementType>,
Expand All @@ -125,7 +128,7 @@ function render(
'',
nativeOnUncaughtError,
nativeOnCaughtError,
defaultOnRecoverableError,
nativeOnRecoverableError,
null,
);
roots.set(containerTag, root);
Expand Down
7 changes: 5 additions & 2 deletions packages/react-native-renderer/src/ReactNativeRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
getPublicRootInstance,
defaultOnUncaughtError,
defaultOnCaughtError,
defaultOnRecoverableError,
} from 'react-reconciler/src/ReactFiberReconciler';
// TODO: direct imports like some-package/src/* are bad. Fix me.
import {getStackByFiberInDevAndProd} from 'react-reconciler/src/ReactFiberComponentStack';
Expand Down Expand Up @@ -105,6 +104,10 @@ function nativeOnCaughtError(

defaultOnCaughtError(error, errorInfo);
}
function nativeOnRecoverableError(error: mixed): void {
// eslint-disable-next-line react-internal/no-production-logging, react-internal/warning-args
console.error(error);
}

function render(
element: Element<ElementType>,
Expand All @@ -129,7 +132,7 @@ function render(
'',
nativeOnUncaughtError,
nativeOnCaughtError,
defaultOnRecoverableError,
nativeOnRecoverableError,
null,
);
roots.set(containerTag, root);
Expand Down