diff --git a/ReactCommon/fabric/components/view/ViewProps.h b/ReactCommon/fabric/components/view/ViewProps.h index b6740b830f2..a185e84fafe 100644 --- a/ReactCommon/fabric/components/view/ViewProps.h +++ b/ReactCommon/fabric/components/view/ViewProps.h @@ -34,33 +34,33 @@ class ViewProps : public Props, #pragma mark - Props // Color - Float const opacity{1.0}; - SharedColor const foregroundColor{}; - SharedColor const backgroundColor{}; + Float opacity{1.0}; + SharedColor foregroundColor{}; + SharedColor backgroundColor{}; // Borders - CascadedBorderRadii const borderRadii{}; - CascadedBorderColors const borderColors{}; - CascadedBorderStyles const borderStyles{}; + CascadedBorderRadii borderRadii{}; + CascadedBorderColors borderColors{}; + CascadedBorderStyles borderStyles{}; // Shadow - SharedColor const shadowColor{}; - Size const shadowOffset{}; - Float const shadowOpacity{}; - Float const shadowRadius{}; + SharedColor shadowColor{}; + Size shadowOffset{}; + Float shadowOpacity{}; + Float shadowRadius{}; // Transform Transform transform{}; - BackfaceVisibility const backfaceVisibility{}; - bool const shouldRasterize{}; - int const zIndex{}; + BackfaceVisibility backfaceVisibility{}; + bool shouldRasterize{}; + int zIndex{}; // Events - PointerEventsMode const pointerEvents{}; - EdgeInsets const hitSlop{}; - bool const onLayout{}; + PointerEventsMode pointerEvents{}; + EdgeInsets hitSlop{}; + bool onLayout{}; - bool const collapsable{true}; + bool collapsable{true}; #pragma mark - Convenience Methods diff --git a/ReactCommon/fabric/core/shadownode/Props.h b/ReactCommon/fabric/core/shadownode/Props.h index 0816b1c49a5..340041448c7 100644 --- a/ReactCommon/fabric/core/shadownode/Props.h +++ b/ReactCommon/fabric/core/shadownode/Props.h @@ -31,7 +31,7 @@ class Props : public virtual Sealable, public virtual DebugStringConvertible { Props(Props const &sourceProps, RawProps const &rawProps); virtual ~Props() = default; - std::string const nativeId; + std::string nativeId; /* * Special value that represents generation number of `Props` object, which diff --git a/ReactCommon/fabric/element/tests/ElementTest.cpp b/ReactCommon/fabric/element/tests/ElementTest.cpp index 43f5d487c2a..8c838eb5c74 100644 --- a/ReactCommon/fabric/element/tests/ElementTest.cpp +++ b/ReactCommon/fabric/element/tests/ElementTest.cpp @@ -33,8 +33,8 @@ TEST(ElementTest, testNormalCases) { auto shadowNodeAB = std::shared_ptr{}; auto shadowNodeABA = std::shared_ptr{}; - auto propsAA = std::make_shared(); - const_cast(propsAA->nativeId) = "node AA"; + auto propsAA = std::make_shared(); + propsAA->nativeId = "node AA"; // clang-format off auto element = @@ -42,9 +42,9 @@ TEST(ElementTest, testNormalCases) { .reference(shadowNodeA) .tag(1) .props([]() { - auto props = std::make_shared(); - const_cast(props->zIndex) = 42; - const_cast(props->nativeId) = "node A"; + auto props = std::make_shared(); + props->zIndex = 42; + props->nativeId = "node A"; return props; }) .finalize([](ViewShadowNode &shadowNode){ @@ -59,8 +59,8 @@ TEST(ElementTest, testNormalCases) { .reference(shadowNodeAB) .tag(3) .props([]() { - auto props = std::make_shared(); - const_cast(props->nativeId) = "node AB"; + auto props = std::make_shared(); + props->nativeId = "node AB"; return props; }) .children({ @@ -68,8 +68,8 @@ TEST(ElementTest, testNormalCases) { .reference(shadowNodeABA) .tag(4) .props([]() { - auto props = std::make_shared(); - const_cast(props->nativeId) = "node ABA"; + auto props = std::make_shared(); + props->nativeId = "node ABA"; return props; }) })