diff --git a/packages/react-reconciler/src/ReactFiberCompleteWork.new.js b/packages/react-reconciler/src/ReactFiberCompleteWork.new.js index 0a187f9c84b07..1b353a097268d 100644 --- a/packages/react-reconciler/src/ReactFiberCompleteWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCompleteWork.new.js @@ -738,6 +738,11 @@ function bubbleProperties(completedWork: Fiber) { subtreeFlags |= child.subtreeFlags; subtreeFlags |= child.flags; + // Update the return pointer so the tree is consistent. This is a code + // smell because it assumes the commit phase is never concurrent with + // the render phase. Will address during refactor to alternate model. + child.return = completedWork; + child = child.sibling; } } @@ -784,6 +789,11 @@ function bubbleProperties(completedWork: Fiber) { subtreeFlags |= child.subtreeFlags & StaticMask; subtreeFlags |= child.flags & StaticMask; + // Update the return pointer so the tree is consistent. This is a code + // smell because it assumes the commit phase is never concurrent with + // the render phase. Will address during refactor to alternate model. + child.return = completedWork; + child = child.sibling; } }