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
This commit is contained in:
Valentin Shergin authored and Facebook Github Bot committed 2019-02-25 12:21:01 -08:00
1 parent e00f62022e
commit 30141e230d
1 file changed
+3 -1
+3 -1
View File
@@ -94,7 +94,9 @@ ShadowTree::ShadowTree(
.props = props,
.eventEmitter = noopEventEmitter,
},
nullptr);
[](const ShadowNode &shadowNode, const ShadowNodeFragment &fragment) {
return std::make_shared<RootShadowNode>(shadowNode, fragment);
});
}
ShadowTree::~ShadowTree() {