diff --git a/ReactCommon/fabric/uimanager/Scheduler.cpp b/ReactCommon/fabric/uimanager/Scheduler.cpp index a06fffcca..478f52def 100644 --- a/ReactCommon/fabric/uimanager/Scheduler.cpp +++ b/ReactCommon/fabric/uimanager/Scheduler.cpp @@ -49,6 +49,7 @@ Scheduler::Scheduler(const SharedContextContainer &contextContainer) eventDispatcher, contextContainer); uiManagerRef.setDelegate(this); + uiManagerRef.setShadowTreeRegistry(&shadowTreeRegistry_); uiManagerRef.setComponentDescriptorRegistry(componentDescriptorRegistry_); runtimeExecutor_([=](jsi::Runtime &runtime) { diff --git a/ReactCommon/fabric/uimanager/UIManager.cpp b/ReactCommon/fabric/uimanager/UIManager.cpp index 881362cb2..d56649f06 100644 --- a/ReactCommon/fabric/uimanager/UIManager.cpp +++ b/ReactCommon/fabric/uimanager/UIManager.cpp @@ -67,6 +67,10 @@ void UIManager::completeSurface( } } +void UIManager::setShadowTreeRegistry(ShadowTreeRegistry *shadowTreeRegistry) { + shadowTreeRegistry_ = shadowTreeRegistry; +} + void UIManager::setComponentDescriptorRegistry( const SharedComponentDescriptorRegistry &componentDescriptorRegistry) { componentDescriptorRegistry_ = componentDescriptorRegistry; diff --git a/ReactCommon/fabric/uimanager/UIManager.h b/ReactCommon/fabric/uimanager/UIManager.h index f7431c9ad..b16cff07d 100644 --- a/ReactCommon/fabric/uimanager/UIManager.h +++ b/ReactCommon/fabric/uimanager/UIManager.h @@ -8,6 +8,7 @@ #include #include +#include #include namespace facebook { @@ -15,6 +16,8 @@ namespace react { class UIManager { public: + void setShadowTreeRegistry(ShadowTreeRegistry *shadowTreeRegistry); + void setComponentDescriptorRegistry( const SharedComponentDescriptorRegistry &componentDescriptorRegistry); @@ -49,6 +52,7 @@ class UIManager { SurfaceId surfaceId, const SharedShadowNodeUnsharedList &rootChildren) const; + ShadowTreeRegistry *shadowTreeRegistry_; SharedComponentDescriptorRegistry componentDescriptorRegistry_; UIManagerDelegate *delegate_; }; diff --git a/ReactCommon/fabric/uimanager/UIManagerBinding.cpp b/ReactCommon/fabric/uimanager/UIManagerBinding.cpp index 05341d3d7..6c460e973 100644 --- a/ReactCommon/fabric/uimanager/UIManagerBinding.cpp +++ b/ReactCommon/fabric/uimanager/UIManagerBinding.cpp @@ -90,6 +90,7 @@ void UIManagerBinding::dispatchEvent( } void UIManagerBinding::invalidate() const { + uiManager_->setShadowTreeRegistry(nullptr); uiManager_->setDelegate(nullptr); }