Don't increase priority when cloning current children (#10123)
This fixes a snapshot test regression introduced by #10008. I had noticed this change and believe the new behavior was correct, but upon further investigation I was wrong. This reverts the snapshot test and fixes it accordingly.
Andrew Clark committed
Jul 7, 2017 at 15:34 UTC
ce7c01429cec571afb5b5dea4889e801705ea4cd
3 files changed
+8
-8
src/renderers/shared/fiber/ReactChildFiber.js
+5
-3
@@ -1449,7 +1449,6 @@ exports.mountChildFibersInPlace = ChildReconciler(false, false);
1449
exports.cloneChildFibers = function(
1450
current: Fiber | null,
1451
workInProgress: Fiber,
1452
- renderPriority: PriorityLevel,
1452
): void {
1453
invariant(
1454
current === null || workInProgress.child === current.child,
@@ -1461,7 +1460,10 @@ exports.cloneChildFibers = function(
1460
}
1461
1462
let currentChild = workInProgress.child;
1464
- let newChild = createWorkInProgress(currentChild, renderPriority);
1463
+ let newChild = createWorkInProgress(
1464
+ currentChild,
1465
+ currentChild.pendingWorkPriority,
1466
+ );
1467
// TODO: Pass this as an argument, since it's easy to forget.
1468
newChild.pendingProps = currentChild.pendingProps;
1469
workInProgress.child = newChild;
@@ -1471,7 +1473,7 @@ exports.cloneChildFibers = function(
1473
currentChild = currentChild.sibling;
1474
newChild = newChild.sibling = createWorkInProgress(
1475
currentChild,
1474
- renderPriority,
1476
+ currentChild.pendingWorkPriority,
1477
);
1478
newChild.pendingProps = currentChild.pendingProps;
1479
newChild.return = workInProgress;
src/renderers/shared/fiber/ReactFiberBeginWork.js
+1
-3
@@ -674,9 +674,7 @@ module.exports = function<T, P, I, TI, PI, C, CX, PL>(
674
// return null;
675
// }
676
677
- // TODO: Pass the priority as an argument
678
- const renderPriority = workInProgress.pendingWorkPriority;
679
- cloneChildFibers(current, workInProgress, renderPriority);
677
+ cloneChildFibers(current, workInProgress);
678
return workInProgress.child;
679
}
680
src/renderers/shared/fiber/__tests__/__snapshots__/ReactIncrementalPerf-test.js.snap
+2
-2
@@ -61,8 +61,8 @@ exports[`ReactDebugFiberPerf deduplicates lifecycle names during commit to reduc
61
⚛ B.componentDidUpdate
62
⚛ B [update]
63
⛔ (Committing Changes) Warning: Caused by a cascading update in earlier commit
64
- ⚛ (Committing Host Effects: 6 Total)
65
- ⚛ (Calling Lifecycle Methods: 6 Total)
64
+ ⚛ (Committing Host Effects: 3 Total)
65
+ ⚛ (Calling Lifecycle Methods: 3 Total)
66
⚛ B.componentDidUpdate
67
"
68
`;