mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
e00f62022e
commit
30141e230d
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user