diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.new.js b/packages/react-reconciler/src/ReactFiberCommitWork.new.js index 0542519d80bc8..8bd7df0e0e410 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.new.js @@ -3060,19 +3060,18 @@ function commitPassiveMountOnFiber( // and add a start transition callback for each of them const instance = finishedWork.stateNode; if ( - instance.pendingSuspenseBoundaries === null || - instance.pendingSuspenseBoundaries.size === 0 + instance.transitions !== null && + (instance.pendingSuspenseBoundaries === null || + instance.pendingSuspenseBoundaries.size === 0) ) { - if (instance.transitions !== null) { - instance.transitions.forEach(transition => { - addMarkerCompleteCallbackToPendingTransition({ - transition, - name: finishedWork.memoizedProps.name, - }); + instance.transitions.forEach(transition => { + addMarkerCompleteCallbackToPendingTransition({ + transition, + name: finishedWork.memoizedProps.name, }); - instance.transitions = null; - instance.pendingSuspenseBoundaries = null; - } + }); + instance.transitions = null; + instance.pendingSuspenseBoundaries = null; } } break; diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.old.js b/packages/react-reconciler/src/ReactFiberCommitWork.old.js index 5486ae844c391..56615329053ad 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.old.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.old.js @@ -3060,19 +3060,18 @@ function commitPassiveMountOnFiber( // and add a start transition callback for each of them const instance = finishedWork.stateNode; if ( - instance.pendingSuspenseBoundaries === null || - instance.pendingSuspenseBoundaries.size === 0 + instance.transitions !== null && + (instance.pendingSuspenseBoundaries === null || + instance.pendingSuspenseBoundaries.size === 0) ) { - if (instance.transitions !== null) { - instance.transitions.forEach(transition => { - addMarkerCompleteCallbackToPendingTransition({ - transition, - name: finishedWork.memoizedProps.name, - }); + instance.transitions.forEach(transition => { + addMarkerCompleteCallbackToPendingTransition({ + transition, + name: finishedWork.memoizedProps.name, }); - instance.transitions = null; - instance.pendingSuspenseBoundaries = null; - } + }); + instance.transitions = null; + instance.pendingSuspenseBoundaries = null; } } break;