diff --git a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerUpdateShadowTree.cpp b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerUpdateShadowTree.cpp index 8fb2e50ad31..50e6e545d62 100644 --- a/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerUpdateShadowTree.cpp +++ b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerUpdateShadowTree.cpp @@ -141,6 +141,13 @@ void UIManager::updateShadowTree( // Add all its ancestors to shadowNodesToUpdate list addAncestorsToUpdateList( shadowNode, rootShadowNode, shadowNodesToUpdate); + + // Every node and its ancestors are in the list, so the rest of the + // tree does not need to be visited. + if (remainingTagToProps.empty()) { + deque.clear(); + break; + } } for (const auto& child : shadowNode->getChildren()) { deque.push_back(child);