Fabric: Remove designated initializers in RootShadowNode (#23715)

Summary:
This pull request removes the designated initializers in `RootShadowNode.cpp`. This will help improve the portability of this file.

[General] [Fixed] - Removed designated initializers in `RootShadowNode`
Pull Request resolved: https://github.com/facebook/react-native/pull/23715

Differential Revision: D14305167

Pulled By: shergin

fbshipit-source-id: e394580f103fdb59cf078828b5d2ee6df6cc534d
This commit is contained in:
empyrical
2019-03-04 14:38:09 -08:00
committed by Facebook Github Bot
parent 2ca8c94559
commit b30b10326e

View File

@@ -31,7 +31,12 @@ UnsharedRootShadowNode RootShadowNode::clone(
auto props = std::make_shared<const RootProps>(
*getProps(), layoutConstraints, layoutContext);
auto newRootShadowNode = std::make_shared<RootShadowNode>(
*this, ShadowNodeFragment{.props = props});
*this,
ShadowNodeFragment{
/* .tag = */ ShadowNodeFragment::tagPlaceholder(),
/* .rootTag = */ ShadowNodeFragment::surfaceIdPlaceholder(),
/* .props = */ props,
});
return newRootShadowNode;
}
@@ -54,8 +59,13 @@ UnsharedRootShadowNode RootShadowNode::clone(
std::replace(children.begin(), children.end(), oldChild, newChild);
auto sharedChildren = std::make_shared<SharedShadowNodeList>(children);
auto newParent =
oldParent->clone(ShadowNodeFragment{.children = sharedChildren});
auto newParent = oldParent->clone({
/* .tag = */ ShadowNodeFragment::tagPlaceholder(),
/* .rootTag = */ ShadowNodeFragment::surfaceIdPlaceholder(),
/* .props = */ ShadowNodeFragment::propsPlaceholder(),
/* .eventEmitter = */ ShadowNodeFragment::eventEmitterPlaceholder(),
/* .children = */ sharedChildren,
});
newParent->replaceChild(oldChild, newChild);