Skip to content

Commit c9c6c0a

Browse files
committed
check if the render scheduled higher pri work
1 parent 8f43a85 commit c9c6c0a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,12 @@ function workLoopSync() {
12781278

12791279
function workLoop() {
12801280
// Perform work until Scheduler asks us to yield
1281-
while (workInProgress !== null && !shouldYield()) {
1281+
while (
1282+
workInProgress !== null &&
1283+
!shouldYield() &&
1284+
workInProgressRoot !== null &&
1285+
renderExpirationTime >= workInProgressRoot.firstPendingTime
1286+
) {
12821287
workInProgress = performUnitOfWork(workInProgress);
12831288
}
12841289
}

0 commit comments

Comments
 (0)