From 6d103107337692d4758044aa842fa9e62ec4cc88 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Wed, 26 Feb 2020 22:03:14 -0800 Subject: [PATCH] Fabric: Removing a couple of (ViewProps and YogaStylableProps) constructors Summary: Here we delete several constructors that were needed only because `YogaLayoutableShadowNode::yogaStyle` was private (which is not true anymore). Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC, mdvacca Differential Revision: D20052033 fbshipit-source-id: c2afcaf2fdebb65cdcde6c214c8b78aa35d45e91 --- ReactCommon/fabric/components/root/RootProps.cpp | 6 ++++-- ReactCommon/fabric/components/view/ViewProps.cpp | 2 -- ReactCommon/fabric/components/view/ViewProps.h | 1 - .../fabric/components/view/yoga/YogaStylableProps.cpp | 3 --- ReactCommon/fabric/components/view/yoga/YogaStylableProps.h | 1 - 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ReactCommon/fabric/components/root/RootProps.cpp b/ReactCommon/fabric/components/root/RootProps.cpp index 093876d0272..bdaba370bd7 100644 --- a/ReactCommon/fabric/components/root/RootProps.cpp +++ b/ReactCommon/fabric/components/root/RootProps.cpp @@ -39,9 +39,11 @@ RootProps::RootProps( RootProps const &sourceProps, LayoutConstraints const &layoutConstraints, LayoutContext const &layoutContext) - : ViewProps(yogaStyleFromLayoutConstraints(layoutConstraints)), + : ViewProps(), layoutConstraints(layoutConstraints), - layoutContext(layoutContext){}; + layoutContext(layoutContext) { + yogaStyle = yogaStyleFromLayoutConstraints(layoutConstraints); +}; } // namespace react } // namespace facebook diff --git a/ReactCommon/fabric/components/view/ViewProps.cpp b/ReactCommon/fabric/components/view/ViewProps.cpp index 0c0ac487e8e..13b8f995b21 100644 --- a/ReactCommon/fabric/components/view/ViewProps.cpp +++ b/ReactCommon/fabric/components/view/ViewProps.cpp @@ -18,8 +18,6 @@ namespace facebook { namespace react { -ViewProps::ViewProps(YGStyle const &yogaStyle) : YogaStylableProps(yogaStyle) {} - ViewProps::ViewProps(ViewProps const &sourceProps, RawProps const &rawProps) : Props(sourceProps, rawProps), YogaStylableProps(sourceProps, rawProps), diff --git a/ReactCommon/fabric/components/view/ViewProps.h b/ReactCommon/fabric/components/view/ViewProps.h index a185e84fafe..6319f556138 100644 --- a/ReactCommon/fabric/components/view/ViewProps.h +++ b/ReactCommon/fabric/components/view/ViewProps.h @@ -28,7 +28,6 @@ class ViewProps : public Props, public AccessibilityProps { public: ViewProps() = default; - ViewProps(YGStyle const &yogaStyle); ViewProps(ViewProps const &sourceProps, RawProps const &rawProps); #pragma mark - Props diff --git a/ReactCommon/fabric/components/view/yoga/YogaStylableProps.cpp b/ReactCommon/fabric/components/view/yoga/YogaStylableProps.cpp index c5cb90d5393..859b4057f1e 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaStylableProps.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaStylableProps.cpp @@ -19,9 +19,6 @@ namespace facebook { namespace react { -YogaStylableProps::YogaStylableProps(YGStyle const &yogaStyle) - : yogaStyle(yogaStyle) {} - YogaStylableProps::YogaStylableProps( YogaStylableProps const &sourceProps, RawProps const &rawProps) diff --git a/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h b/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h index f9f13bdc6d2..e93d1381895 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h +++ b/ReactCommon/fabric/components/view/yoga/YogaStylableProps.h @@ -18,7 +18,6 @@ namespace react { class YogaStylableProps { public: YogaStylableProps() = default; - YogaStylableProps(YGStyle const &yogaStyle); YogaStylableProps( YogaStylableProps const &sourceProps, RawProps const &rawProps);