Skip to content

Commit a684f09

Browse files
committed
Make NoWork big instead of small
1 parent 7268d97 commit a684f09

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

packages/react-reconciler/src/ReactFiberExpirationTime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import MAX_SIGNED_31_BIT_INT from './maxSigned31BitInt';
1111

1212
export type ExpirationTime = number;
1313

14-
export const NoWork = 0;
14+
export const NoWork = MAX_SIGNED_31_BIT_INT;
1515
export const Sync = 1;
16-
export const Never = MAX_SIGNED_31_BIT_INT;
16+
export const Never = MAX_SIGNED_31_BIT_INT - 1;
1717

1818
const UNIT_SIZE = 10;
1919
const MAGIC_NUMBER_OFFSET = 2;

packages/react-reconciler/src/ReactFiberScheduler.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,10 @@ function computeExpirationForFiber(currentTime: ExpirationTime, fiber: Fiber) {
15451545
// This is an interactive update. Keep track of the lowest pending
15461546
// interactive expiration time. This allows us to synchronously flush
15471547
// all interactive updates when needed.
1548-
if (expirationTime > lowestPriorityPendingInteractiveExpirationTime) {
1548+
if (
1549+
lowestPriorityPendingInteractiveExpirationTime === NoWork ||
1550+
expirationTime > lowestPriorityPendingInteractiveExpirationTime
1551+
) {
15491552
lowestPriorityPendingInteractiveExpirationTime = expirationTime;
15501553
}
15511554
}

packages/react-reconciler/src/__tests__/__snapshots__/ReactIncrementalPerf-test.internal.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ exports[`ReactDebugFiberPerf measures deprioritized work 1`] = `
249249
⚛ (Committing Host Effects: 1 Total)
250250
⚛ (Calling Lifecycle Methods: 0 Total)
251251
252-
⚛ (Waiting for async callback... will force flush in 10737418210 ms)
252+
⚛ (Waiting for async callback... will force flush in 10737418200 ms)
253253
254254
// Flush the child
255255
⚛ (React Tree Reconciliation: Completed Root)

0 commit comments

Comments
 (0)