mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost
This commit is contained in:
@@ -450,7 +450,8 @@ function shouldYieldToHost() {
|
||||
}
|
||||
// There's no pending input. Only yield if we've reached the max
|
||||
// yield interval.
|
||||
return currentTime >= maxYieldInterval;
|
||||
const timeElapsed = currentTime - (deadline - yieldInterval);
|
||||
return timeElapsed >= maxYieldInterval;
|
||||
} else {
|
||||
// There's still time left in the frame.
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user