diff --git a/src/renderers/shared/fiber/ReactChildFiber.js b/src/renderers/shared/fiber/ReactChildFiber.js index 655e2a1e85d..69c0058cdaa 100644 --- a/src/renderers/shared/fiber/ReactChildFiber.js +++ b/src/renderers/shared/fiber/ReactChildFiber.js @@ -288,7 +288,7 @@ function ChildReconciler(shouldClone, shouldTrackSideEffects) { // We currently set sibling to null and index to 0 here because it is easy // to forget to do before returning it. E.g. for the single child case. if (shouldClone) { - const clone = createWorkInProgress(fiber, priority); + const clone = createWorkInProgress(fiber, priority, null); clone.index = 0; clone.sibling = null; return clone; @@ -1443,9 +1443,8 @@ exports.cloneChildFibers = function( let newChild = createWorkInProgress( currentChild, currentChild.pendingWorkPriority, + currentChild.pendingProps, ); - // TODO: Pass this as an argument, since it's easy to forget. - newChild.pendingProps = currentChild.pendingProps; workInProgress.child = newChild; newChild.return = workInProgress; @@ -1454,8 +1453,8 @@ exports.cloneChildFibers = function( newChild = newChild.sibling = createWorkInProgress( currentChild, currentChild.pendingWorkPriority, + currentChild.pendingProps, ); - newChild.pendingProps = currentChild.pendingProps; newChild.return = workInProgress; } newChild.sibling = null; diff --git a/src/renderers/shared/fiber/ReactFiber.js b/src/renderers/shared/fiber/ReactFiber.js index 2a07cf2dc63..a64030fc684 100644 --- a/src/renderers/shared/fiber/ReactFiber.js +++ b/src/renderers/shared/fiber/ReactFiber.js @@ -237,6 +237,7 @@ function shouldConstruct(Component) { exports.createWorkInProgress = function( current: Fiber, renderPriority: PriorityLevel, + pendingProps: any, ): Fiber { let workInProgress = current.alternate; if (workInProgress === null) { @@ -281,7 +282,7 @@ exports.createWorkInProgress = function( workInProgress.updateQueue = current.updateQueue; // pendingProps is set by the parent during reconciliation. - // TODO: Pass this as an argument. + workInProgress.pendingProps = pendingProps; // These will be overridden during the parent's reconciliation workInProgress.sibling = current.sibling;