diff --git a/packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp b/packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp index efe6ae574e265e..7ed03caffe9494 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp @@ -104,10 +104,6 @@ inline bool isYogaStyleProp(const std::string& prop) { } } // namespace -RawProps::RawProps() { - mode_ = Mode::Empty; -} - /* * Creates an object with given `runtime` and `value`. */ @@ -149,18 +145,6 @@ RawProps::RawProps(const RawProps& other) noexcept { ignoreYogaStyleProps_ = other.ignoreYogaStyleProps_; } -RawProps& RawProps::operator=(const RawProps& other) noexcept { - mode_ = other.mode_; - if (mode_ == Mode::JSI) { - runtime_ = other.runtime_; - value_ = jsi::Value(*runtime_, other.value_); - } else if (mode_ == Mode::Dynamic) { - dynamic_ = other.dynamic_; - } - ignoreYogaStyleProps_ = other.ignoreYogaStyleProps_; - return *this; -} - void RawProps::parse(const RawPropsParser& parser) noexcept { react_native_assert(parser_ == nullptr && "A parser was already assigned."); parser_ = &parser; diff --git a/packages/react-native/ReactCommon/react/renderer/core/RawProps.h b/packages/react-native/ReactCommon/react/renderer/core/RawProps.h index 3e63bce5a7449a..efe63e927be49f 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/RawProps.h +++ b/packages/react-native/ReactCommon/react/renderer/core/RawProps.h @@ -43,7 +43,7 @@ class RawProps final { /* * Creates empty RawProps objects. */ - RawProps(); + RawProps() : mode_(Mode::Empty) {} /* * Creates an object with given `runtime` and `value`. @@ -51,10 +51,10 @@ class RawProps final { RawProps(jsi::Runtime& runtime, const jsi::Value& value) noexcept; explicit RawProps(const RawProps& rawProps) noexcept; - RawProps& operator=(const RawProps& other) noexcept; - RawProps(RawProps&& other) noexcept = default; - RawProps& operator=(RawProps&& other) noexcept = default; + + RawProps& operator=(const RawProps& other) noexcept = delete; + RawProps& operator=(RawProps&& other) noexcept = delete; /* * Creates an object with given `folly::dynamic` object. @@ -112,8 +112,9 @@ class RawProps final { /* * Source artefacts: */ + // Mode - mutable Mode mode_; + Mode mode_; // Case 1: Source data is represented as `jsi::Object`. jsi::Runtime* runtime_{};