From f0534ae94a439dc7ac782b973792da59dbde7a7f Mon Sep 17 00:00:00 2001 From: Tianyu Yao Date: Fri, 2 Dec 2022 11:48:58 -0800 Subject: [PATCH] Avoid replaying SelectiveHydrationException in dev (#25754) ## Summary This is discovered by @acdlite. In dev we replay errors so debugger will treat them as uncaught errors, but we need to ignore internal exceptions. ## How did you test this change? manually console.log in some tests, and noticed replay didn't happen. --- packages/react-reconciler/src/ReactFiberWorkLoop.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js index 5046d38b589c2..24901177563d3 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js @@ -3771,6 +3771,7 @@ if (__DEV__ && replayFailedUnitOfWorkWithInvokeGuardedCallback) { if ( didSuspendOrErrorWhileHydratingDEV() || originalError === SuspenseException || + originalError === SelectiveHydrationException || (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function')