Skip to content

Commit 348302e

Browse files
committed
Add comment
1 parent 2299d1d commit 348302e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,12 @@ function handleError(root, thrownValue) {
12851285
// boundary.
12861286
workInProgressRootExitStatus = RootFatalErrored;
12871287
workInProgressRootFatalError = thrownValue;
1288+
// Set `workInProgress` to null. This represents advancing to the next
1289+
// sibling, or the parent if there are no siblings. But since the root
1290+
// has no siblings nor a parent, we set it to null. Usually this is
1291+
// handled by `completeUnitOfWork` or `unwindWork`, but since we're
1292+
// interntionally not calling those, we need set it here.
1293+
// TODO: Consider calling `unwindWork` to pop the contexts.
12881294
workInProgress = null;
12891295
return null;
12901296
}

0 commit comments

Comments
 (0)