From b30b10326e063e614316c97d3cdb1438915ea4f6 Mon Sep 17 00:00:00 2001 From: empyrical Date: Mon, 4 Mar 2019 14:38:09 -0800 Subject: [PATCH] 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 --- .../fabric/components/root/RootShadowNode.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ReactCommon/fabric/components/root/RootShadowNode.cpp b/ReactCommon/fabric/components/root/RootShadowNode.cpp index f10e7ee3c..85a11ea02 100644 --- a/ReactCommon/fabric/components/root/RootShadowNode.cpp +++ b/ReactCommon/fabric/components/root/RootShadowNode.cpp @@ -31,7 +31,12 @@ UnsharedRootShadowNode RootShadowNode::clone( auto props = std::make_shared( *getProps(), layoutConstraints, layoutContext); auto newRootShadowNode = std::make_shared( - *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(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);