Compare commits

...

1 Commits

Author SHA1 Message Date
Tianyu Yao
a23bf3d076 Revert to use console.error for onRecoverableError 2024-04-12 12:12:01 -07:00
2 changed files with 10 additions and 4 deletions

View File

@@ -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);

View File

@@ -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);