From 30141e230d39063d8dc2c8db72f76b5e39b0660a Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 25 Feb 2019 12:17:48 -0800 Subject: [PATCH] Fabric: Clone function for RootShadowNode Summary: RootShadowNode does not have ComponentDescriptor counterpart (because it cannot be created via UIManager) and we used to always clone it manually. However, apparently, some algorithms (e.g. clone algorithm inside RootShadowNode, which is used by setNativeProps) require valid clone function associated with the node. So, we implement it. Reviewed By: JoshuaGross Differential Revision: D14187762 fbshipit-source-id: a9b6b332a18583217ff0e4f9c15aea0ffb113ba2 --- ReactCommon/fabric/uimanager/ShadowTree.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReactCommon/fabric/uimanager/ShadowTree.cpp b/ReactCommon/fabric/uimanager/ShadowTree.cpp index 1968bc9af6a..6e5e722a424 100644 --- a/ReactCommon/fabric/uimanager/ShadowTree.cpp +++ b/ReactCommon/fabric/uimanager/ShadowTree.cpp @@ -94,7 +94,9 @@ ShadowTree::ShadowTree( .props = props, .eventEmitter = noopEventEmitter, }, - nullptr); + [](const ShadowNode &shadowNode, const ShadowNodeFragment &fragment) { + return std::make_shared(shadowNode, fragment); + }); } ShadowTree::~ShadowTree() {