Deprecate YGNode::setConfig
Summary: We want to phase out usage of config pointers on nodes. Setting configs is no longer needed, as a config is unly used during construction. Here we deprecate the setter, as it is no longer working as it used to (e.g. changing `useWebDefaults` after a node is constructed). Reviewed By: SidharthGuglani Differential Revision: D15416474 fbshipit-source-id: a2cc06cad0c5148cecce056ece5f141b3defe9a9
This commit is contained in:
committed by
Facebook Github Bot
parent
b74c0d4766
commit
cea3865c74
@@ -253,7 +253,13 @@ static YGConfigRef YGConfigClone(const YGConfig& oldConfig) {
|
||||
}
|
||||
|
||||
static YGNodeRef YGNodeDeepClone(YGNodeRef oldNode) {
|
||||
YGNodeRef node = YGNodeClone(oldNode);
|
||||
auto config = YGConfigClone(*oldNode->getConfig());
|
||||
auto node = new YGNode{*oldNode, config};
|
||||
node->setOwner(nullptr);
|
||||
#ifdef YG_ENABLE_EVENTS
|
||||
Event::publish<Event::NodeAllocation>(node, {node->getConfig()});
|
||||
#endif
|
||||
|
||||
YGVector vec = YGVector();
|
||||
vec.reserve(oldNode->getChildren().size());
|
||||
YGNodeRef childNode = nullptr;
|
||||
@@ -264,10 +270,6 @@ static YGNodeRef YGNodeDeepClone(YGNodeRef oldNode) {
|
||||
}
|
||||
node->setChildren(vec);
|
||||
|
||||
if (oldNode->getConfig() != nullptr) {
|
||||
node->setConfig(YGConfigClone(*(oldNode->getConfig())));
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user