Skip to content

Commit

Permalink
Warn if finishedLanes is empty in commit phase
Browse files Browse the repository at this point in the history
See facebook#21233 for context.
  • Loading branch information
acdlite committed Apr 13, 2021
1 parent 84c06fe commit d36d255
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,15 @@ function commitRootImpl(root, renderPriorityLevel) {
}

return null;
} else {
if (__DEV__) {
if (lanes === NoLanes) {
console.error(
'root.finishedLanes should not be empty during a commit. This is a ' +
'bug in React.',
);
}
}
}
root.finishedWork = null;
root.finishedLanes = NoLanes;
Expand Down
9 changes: 9 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,15 @@ function commitRootImpl(root, renderPriorityLevel) {
}

return null;
} else {
if (__DEV__) {
if (lanes === NoLanes) {
console.error(
'root.finishedLanes should not be empty during a commit. This is a ' +
'bug in React.',
);
}
}
}
root.finishedWork = null;
root.finishedLanes = NoLanes;
Expand Down

0 comments on commit d36d255

Please sign in to comment.