Skip to content

Commit d36d255

Browse files
committed
Warn if finishedLanes is empty in commit phase
See facebook#21233 for context.
1 parent 84c06fe commit d36d255

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.new.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,15 @@ function commitRootImpl(root, renderPriorityLevel) {
18261826
}
18271827

18281828
return null;
1829+
} else {
1830+
if (__DEV__) {
1831+
if (lanes === NoLanes) {
1832+
console.error(
1833+
'root.finishedLanes should not be empty during a commit. This is a ' +
1834+
'bug in React.',
1835+
);
1836+
}
1837+
}
18291838
}
18301839
root.finishedWork = null;
18311840
root.finishedLanes = NoLanes;

packages/react-reconciler/src/ReactFiberWorkLoop.old.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,15 @@ function commitRootImpl(root, renderPriorityLevel) {
18261826
}
18271827

18281828
return null;
1829+
} else {
1830+
if (__DEV__) {
1831+
if (lanes === NoLanes) {
1832+
console.error(
1833+
'root.finishedLanes should not be empty during a commit. This is a ' +
1834+
'bug in React.',
1835+
);
1836+
}
1837+
}
18291838
}
18301839
root.finishedWork = null;
18311840
root.finishedLanes = NoLanes;

0 commit comments

Comments
 (0)