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
2019-02-25 12:17:48 -08:00
committed by Facebook Github Bot
parent e00f62022e
commit 30141e230d
+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() {