From 668cc2fbde213d89bb869e2e90aded0e11f48d35 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Thu, 15 Oct 2020 10:38:22 -0700 Subject: [PATCH] Remove setNativeProps from core Summary: Changelog: [internal] Fabric uses view commands instead of setNativeProps. This diff removes what's left of setNativeProps from the core. Reviewed By: JoshuaGross Differential Revision: D24309999 fbshipit-source-id: 70e54f0a984f8c36f77ba2cd59f59fc6923bc832 --- .../react/renderer/uimanager/UIManager.cpp | 25 ------------------- .../react/renderer/uimanager/UIManager.h | 3 --- .../renderer/uimanager/UIManagerBinding.cpp | 18 ------------- 3 files changed, 46 deletions(-) diff --git a/ReactCommon/react/renderer/uimanager/UIManager.cpp b/ReactCommon/react/renderer/uimanager/UIManager.cpp index a8b4c696480..148d51eec7a 100644 --- a/ReactCommon/react/renderer/uimanager/UIManager.cpp +++ b/ReactCommon/react/renderer/uimanager/UIManager.cpp @@ -162,31 +162,6 @@ ShadowNode::Shared UIManager::findNodeAtPoint( getNewestCloneOfShadowNode(*node), point); } -void UIManager::setNativeProps( - ShadowNode const &shadowNode, - RawProps const &rawProps) const { - SystraceSection s("UIManager::setNativeProps"); - - auto &componentDescriptor = shadowNode.getComponentDescriptor(); - auto props = componentDescriptor.cloneProps(shadowNode.getProps(), rawProps); - - shadowTreeRegistry_.visit( - shadowNode.getSurfaceId(), [&](ShadowTree const &shadowTree) { - shadowTree.tryCommit( - [&](RootShadowNode const &oldRootShadowNode) { - return std::static_pointer_cast( - oldRootShadowNode.cloneTree( - shadowNode.getFamily(), - [&](ShadowNode const &oldShadowNode) { - return oldShadowNode.clone({ - /* .props = */ props, - }); - })); - }, - true); - }); -} - LayoutMetrics UIManager::getRelativeLayoutMetrics( ShadowNode const &shadowNode, ShadowNode const *ancestorShadowNode, diff --git a/ReactCommon/react/renderer/uimanager/UIManager.h b/ReactCommon/react/renderer/uimanager/UIManager.h index 1235cf3532a..f8ea0579760 100644 --- a/ReactCommon/react/renderer/uimanager/UIManager.h +++ b/ReactCommon/react/renderer/uimanager/UIManager.h @@ -102,9 +102,6 @@ class UIManager final : public ShadowTreeDelegate { SurfaceId surfaceId, const SharedShadowNodeUnsharedList &rootChildren) const; - void setNativeProps(ShadowNode const &shadowNode, RawProps const &rawProps) - const; - void setJSResponder( const ShadowNode::Shared &shadowNode, const bool blockNativeResponder) const; diff --git a/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp b/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp index 14eee6775f4..8dff84333ad 100644 --- a/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp +++ b/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp @@ -634,24 +634,6 @@ jsi::Value UIManagerBinding::get( }); } - if (methodName == "setNativeProps") { - return jsi::Function::createFromHostFunction( - runtime, - name, - 2, - [uiManager]( - jsi::Runtime & runtime, - jsi::Value const &thisValue, - jsi::Value const *arguments, - size_t count) noexcept->jsi::Value { - uiManager->setNativeProps( - *shadowNodeFromValue(runtime, arguments[0]), - RawProps(runtime, arguments[1])); - - return jsi::Value::undefined(); - }); - } - if (methodName == "configureNextLayoutAnimation") { return jsi::Function::createFromHostFunction( runtime,