From ab920970aed771e3e39332aa7e5417845e80101d Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Fri, 28 Oct 2016 10:58:40 -0700 Subject: [PATCH] Ensure first iteration of performAnimationWork loop has right priority I don't think this actually changes any behavior because of the way findNextUnitOfWork works, but I think this is easier to follow. --- src/renderers/shared/fiber/ReactFiberScheduler.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/renderers/shared/fiber/ReactFiberScheduler.js b/src/renderers/shared/fiber/ReactFiberScheduler.js index fd236dbfce..44af01cb34 100644 --- a/src/renderers/shared/fiber/ReactFiberScheduler.js +++ b/src/renderers/shared/fiber/ReactFiberScheduler.js @@ -425,17 +425,16 @@ module.exports = function(config : HostConfig) { // Always start from the root nextUnitOfWork = findNextUnitOfWork(); while (nextUnitOfWork && - nextPriorityLevel !== NoWork) { + nextPriorityLevel !== NoWork && + nextPriorityLevel <= AnimationPriority) { nextUnitOfWork = performUnitOfWork(nextUnitOfWork, false); if (!nextUnitOfWork) { // Keep searching for animation work until there's no more left nextUnitOfWork = findNextUnitOfWork(); } - // Stop if the next unit of work is low priority - if (nextPriorityLevel > AnimationPriority) { - scheduleDeferredCallback(performDeferredWork); - return; - } + } + if (nextUnitOfWork && nextPriorityLevel > AnimationPriority) { + scheduleDeferredCallback(performDeferredWork); } }