diff --git a/ReactCommon/react/renderer/mounting/ShadowTree.cpp b/ReactCommon/react/renderer/mounting/ShadowTree.cpp index 88e3f3a8b3b..3a56b4631cc 100644 --- a/ReactCommon/react/renderer/mounting/ShadowTree.cpp +++ b/ReactCommon/react/renderer/mounting/ShadowTree.cpp @@ -371,7 +371,8 @@ CommitStatus ShadowTree::tryCommit( newRootShadowNode = delegate_.shadowTreeWillCommit( *this, oldRootShadowNode, newRootShadowNode); - if (!newRootShadowNode) { + if (!newRootShadowNode || + (commitOptions.shouldCancel && commitOptions.shouldCancel())) { return CommitStatus::Cancelled; } @@ -392,10 +393,6 @@ CommitStatus ShadowTree::tryCommit( currentRevision_ = newRevision; } - if (commitOptions.shouldCancel && commitOptions.shouldCancel()) { - return CommitStatus::Cancelled; - } - emitLayoutEvents(affectedLayoutableNodes); if (commitMode == CommitMode::Normal) {