mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
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.
This commit is contained in:
1 parent
2b26ea614d
commit
ab920970ae
1 file changed
+5
-6
@@ -425,17 +425,16 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user