mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Revert to use console.error for onRecoverableError
This commit is contained in:
+5
-2
@@ -22,7 +22,6 @@ import {
|
||||
getPublicRootInstance,
|
||||
defaultOnUncaughtError,
|
||||
defaultOnCaughtError,
|
||||
defaultOnRecoverableError,
|
||||
} from 'react-reconciler/src/ReactFiberReconciler';
|
||||
|
||||
import {createPortal as createPortalImpl} from 'react-reconciler/src/ReactPortal';
|
||||
@@ -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>,
|
||||
@@ -125,7 +128,7 @@ function render(
|
||||
'',
|
||||
nativeOnUncaughtError,
|
||||
nativeOnCaughtError,
|
||||
defaultOnRecoverableError,
|
||||
nativeOnRecoverableError,
|
||||
null,
|
||||
);
|
||||
roots.set(containerTag, root);
|
||||
|
||||
@@ -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';
|
||||
@@ -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>,
|
||||
@@ -129,7 +132,7 @@ function render(
|
||||
'',
|
||||
nativeOnUncaughtError,
|
||||
nativeOnCaughtError,
|
||||
defaultOnRecoverableError,
|
||||
nativeOnRecoverableError,
|
||||
null,
|
||||
);
|
||||
roots.set(containerTag, root);
|
||||
|
||||
Reference in New Issue
Block a user