diff --git a/ReactCommon/fabric/uimanager/Scheduler.cpp b/ReactCommon/fabric/uimanager/Scheduler.cpp index c4319fbd2b9..a79fa696911 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.cpp +++ b/ReactCommon/fabric/uimanager/Scheduler.cpp @@ -241,28 +241,6 @@ void Scheduler::uiManagerDidFinishTransaction( } } -void Scheduler::uiManagerDidFinishTransaction( - SurfaceId surfaceId, - const SharedShadowNodeUnsharedList &rootChildNodes) { - SystraceSection s("Scheduler::uiManagerDidFinishTransaction"); - - uiManager_->getShadowTreeRegistry().visit( - surfaceId, [&](const ShadowTree &shadowTree) { - shadowTree.commit([&](RootShadowNode::Shared const &oldRootShadowNode) { - return std::make_shared( - *oldRootShadowNode, - ShadowNodeFragment{ - /* .tag = */ ShadowNodeFragment::tagPlaceholder(), - /* .surfaceId = */ ShadowNodeFragment::surfaceIdPlaceholder(), - /* .props = */ ShadowNodeFragment::propsPlaceholder(), - /* .eventEmitter = */ - ShadowNodeFragment::eventEmitterPlaceholder(), - /* .children = */ rootChildNodes, - }); - }); - }); -} - void Scheduler::uiManagerDidCreateShadowNode( const SharedShadowNode &shadowNode) { SystraceSection s("Scheduler::uiManagerDidCreateShadowNode"); diff --git a/ReactCommon/fabric/uimanager/Scheduler.h b/ReactCommon/fabric/uimanager/Scheduler.h index 07a0b0eeb69..7a06754758d 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.h +++ b/ReactCommon/fabric/uimanager/Scheduler.h @@ -82,9 +82,6 @@ class Scheduler final : public UIManagerDelegate { void uiManagerDidFinishTransaction( MountingCoordinator::Shared const &mountingCoordinator) override; - void uiManagerDidFinishTransaction( - SurfaceId surfaceId, - const SharedShadowNodeUnsharedList &rootChildNodes) override; void uiManagerDidCreateShadowNode( const SharedShadowNode &shadowNode) override; void uiManagerDidDispatchCommand( diff --git a/ReactCommon/fabric/uimanager/UIManager.cpp b/ReactCommon/fabric/uimanager/UIManager.cpp index 1030dabe263..59572319f39 100644 --- a/ReactCommon/fabric/uimanager/UIManager.cpp +++ b/ReactCommon/fabric/uimanager/UIManager.cpp @@ -104,9 +104,20 @@ void UIManager::completeSurface( const SharedShadowNodeUnsharedList &rootChildren) const { SystraceSection s("UIManager::completeSurface"); - if (delegate_) { - delegate_->uiManagerDidFinishTransaction(surfaceId, rootChildren); - } + shadowTreeRegistry_.visit(surfaceId, [&](ShadowTree const &shadowTree) { + shadowTree.commit([&](RootShadowNode::Shared const &oldRootShadowNode) { + return std::make_shared( + *oldRootShadowNode, + ShadowNodeFragment{ + /* .tag = */ ShadowNodeFragment::tagPlaceholder(), + /* .surfaceId = */ ShadowNodeFragment::surfaceIdPlaceholder(), + /* .props = */ ShadowNodeFragment::propsPlaceholder(), + /* .eventEmitter = */ + ShadowNodeFragment::eventEmitterPlaceholder(), + /* .children = */ rootChildren, + }); + }); + }); } void UIManager::setJSResponder( diff --git a/ReactCommon/fabric/uimanager/UIManagerDelegate.h b/ReactCommon/fabric/uimanager/UIManagerDelegate.h index 99c1542965e..b0e0233e598 100644 --- a/ReactCommon/fabric/uimanager/UIManagerDelegate.h +++ b/ReactCommon/fabric/uimanager/UIManagerDelegate.h @@ -26,14 +26,6 @@ class UIManagerDelegate { virtual void uiManagerDidFinishTransaction( MountingCoordinator::Shared const &mountingCoordinator) = 0; - /* - * Called right after the new/updated Shadow Node tree is constructed. - * The tree is not laid out and not sealed at this time. - */ - virtual void uiManagerDidFinishTransaction( - SurfaceId surfaceId, - const SharedShadowNodeUnsharedList &rootChildNodes) = 0; - /* * Called each time when UIManager constructs a new Shadow Node. Receiver * might use this to optimistically allocate a new native view