Skip to content

Commit fb30d23

Browse files
authored
Remove didCommit from scheduler (#10182)
Don't actually need to track this, now that we removed the infinite loop check to findNextUnitOfWork
1 parent b1a2ac8 commit fb30d23

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/renderers/shared/fiber/ReactFiberScheduler.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
232232
let isUnmounting: boolean = false;
233233

234234
// Use these to prevent an infinite loop of nested updates
235-
let didCommit = false;
236235
let nestedSyncUpdates = 0;
237236
let NESTED_SYNC_UPDATE_LIMIT = 1000;
238237

@@ -291,9 +290,8 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
291290
priorityContext = nextPriorityLevel;
292291

293292
if (
294-
didCommit &&
295-
(nextPriorityLevel === TaskPriority ||
296-
nextPriorityLevel === SynchronousPriority)
293+
nextPriorityLevel === TaskPriority ||
294+
nextPriorityLevel === SynchronousPriority
297295
) {
298296
invariant(
299297
nestedSyncUpdates++ <= NESTED_SYNC_UPDATE_LIMIT,
@@ -434,7 +432,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
434432
// local to this function is because errors that occur during cWU are
435433
// captured elsewhere, to prevent the unmount from being interrupted.
436434
isCommitting = true;
437-
didCommit = true;
438435
if (__DEV__) {
439436
startCommitTimer();
440437
}
@@ -1011,7 +1008,6 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
10111008
firstUncaughtError = null;
10121009
capturedErrors = null;
10131010
failedBoundaries = null;
1014-
didCommit = false;
10151011
nestedSyncUpdates = 0;
10161012
if (__DEV__) {
10171013
stopWorkLoopTimer();

0 commit comments

Comments
 (0)