diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp index 26312ce5934..09c67c66b57 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.cpp @@ -279,8 +279,7 @@ CommitStatus ShadowTree::tryCommit( const auto& oldRootShadowNode = oldRevision.rootShadowNode; auto newRootShadowNode = transaction(*oldRevision.rootShadowNode); - if (!newRootShadowNode || - (commitOptions.shouldYield && commitOptions.shouldYield())) { + if (!newRootShadowNode) { return CommitStatus::Cancelled; } @@ -297,8 +296,7 @@ CommitStatus ShadowTree::tryCommit( newRootShadowNode = delegate_.shadowTreeWillCommit( *this, oldRootShadowNode, newRootShadowNode); - if (!newRootShadowNode || - (commitOptions.shouldYield && commitOptions.shouldYield())) { + if (!newRootShadowNode) { return CommitStatus::Cancelled; } @@ -316,10 +314,6 @@ CommitStatus ShadowTree::tryCommit( // Updating `currentRevision_` in unique manner if it hasn't changed. std::unique_lock lock(commitMutex_); - if (commitOptions.shouldYield && commitOptions.shouldYield()) { - return CommitStatus::Cancelled; - } - if (ReactNativeFeatureFlags:: enableGranularShadowTreeStateReconciliation()) { auto lastRevisionNumberWithNewStateChanged = diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.h b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.h index 2c97dedba3a..b7b813ffd2d 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.h +++ b/packages/react-native/ReactCommon/react/renderer/mounting/ShadowTree.h @@ -66,10 +66,6 @@ class ShadowTree final { // will then let React run layout effects and apply updates before paint. // For all other commits, should be true. bool mountSynchronously{true}; - - // Called during `tryCommit` phase. Returning true indicates current commit - // should yield to the next commit. - std::function shouldYield; }; /* diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index de07a2847b6..a9a97a53dbc 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -483,9 +483,7 @@ jsi::Value UIManagerBinding::get( uiManager->completeSurface( surfaceId, shadowNodeList, - {.enableStateReconciliation = true, - .mountSynchronously = false, - .shouldYield = nullptr}); + {.enableStateReconciliation = true, .mountSynchronously = false}); return jsi::Value::undefined(); });