mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Make NoWork big instead of small
This commit is contained in:
@@ -11,9 +11,9 @@ import MAX_SIGNED_31_BIT_INT from './maxSigned31BitInt';
|
||||
|
||||
export type ExpirationTime = number;
|
||||
|
||||
export const NoWork = 0;
|
||||
export const NoWork = MAX_SIGNED_31_BIT_INT;
|
||||
export const Sync = 1;
|
||||
export const Never = MAX_SIGNED_31_BIT_INT;
|
||||
export const Never = MAX_SIGNED_31_BIT_INT - 1;
|
||||
|
||||
const UNIT_SIZE = 10;
|
||||
const MAGIC_NUMBER_OFFSET = 2;
|
||||
|
||||
+4
-1
@@ -1545,7 +1545,10 @@ function computeExpirationForFiber(currentTime: ExpirationTime, fiber: Fiber) {
|
||||
// This is an interactive update. Keep track of the lowest pending
|
||||
// interactive expiration time. This allows us to synchronously flush
|
||||
// all interactive updates when needed.
|
||||
if (expirationTime > lowestPriorityPendingInteractiveExpirationTime) {
|
||||
if (
|
||||
lowestPriorityPendingInteractiveExpirationTime === NoWork ||
|
||||
expirationTime > lowestPriorityPendingInteractiveExpirationTime
|
||||
) {
|
||||
lowestPriorityPendingInteractiveExpirationTime = expirationTime;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -249,7 +249,7 @@ exports[`ReactDebugFiberPerf measures deprioritized work 1`] = `
|
||||
⚛ (Committing Host Effects: 1 Total)
|
||||
⚛ (Calling Lifecycle Methods: 0 Total)
|
||||
|
||||
⚛ (Waiting for async callback... will force flush in 10737418210 ms)
|
||||
⚛ (Waiting for async callback... will force flush in 10737418200 ms)
|
||||
|
||||
// Flush the child
|
||||
⚛ (React Tree Reconciliation: Completed Root)
|
||||
|
||||
Reference in New Issue
Block a user