From 6f67d0a830e7e696201f141ba26d384038ff3c90 Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Tue, 7 Apr 2020 13:14:51 -0700 Subject: [PATCH] Add TODO Happened to find this while writing a test. A JSX element comparison failed because one of them elements had a functional component as an owner, which should ever happen. I'll add a regression test later. --- packages/react-reconciler/src/ReactFiberWorkLoop.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js index 7e2e8e0cef04..a83f9a6f2505 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js @@ -1215,6 +1215,9 @@ function handleError(root, thrownValue) { resetContextDependencies(); resetHooksAfterThrow(); resetCurrentDebugFiberInDEV(); + // TODO: I found and added this missing line while investigating a + // separate issue. Write a regression test using string refs. + ReactCurrentOwner.current = null; if (workInProgress === null || workInProgress.return === null) { // Expected to be working on a non-root fiber. This is a fatal error