@samitouri / QOS-React / commits / f939c1bca4

Don't reset the return fiber after cloning the child fibers, as we already do that while cloning.

jddxf committed Mar 6, 2017 at 17:08 UTC f939c1bca4cf907616c89c023f0cfddf33d0089a
1 file changed +10 -10
src/renderers/shared/fiber/ReactChildFiber.js
+10 -10
@@ -1353,15 +1353,15 @@ exports.cloneChildFibers = function(current : Fiber | null, workInProgress : Fib
1353 newChild.return = workInProgress;
1354 }
1355 newChild.sibling = null;
1356 - }
1357 -
1358 - // If there is no alternate, then we don't need to clone the children.
1359 - // If the children of the alternate fiber is a different set, then we don't
1360 - // need to clone. We need to reset the return fiber though since we'll
1361 - // traverse down into them.
1362 - let child = workInProgress.child;
1363 - while (child !== null) {
1364 - child.return = workInProgress;
1365 - child = child.sibling;
1356 + } else {
1357 + // If there is no alternate, then we don't need to clone the children.
1358 + // If the children of the alternate fiber is a different set, then we don't
1359 + // need to clone. We need to reset the return fiber though since we'll
1360 + // traverse down into them.
1361 + let child = workInProgress.child;
1362 + while (child !== null) {
1363 + child.return = workInProgress;
1364 + child = child.sibling;
1365 + }
1366 }
1367 };