diff --git a/packages/react-native/ReactCommon/react/renderer/core/Props.cpp b/packages/react-native/ReactCommon/react/renderer/core/Props.cpp index c52951b66ab..6f62ff59b8f 100644 --- a/packages/react-native/ReactCommon/react/renderer/core/Props.cpp +++ b/packages/react-native/ReactCommon/react/renderer/core/Props.cpp @@ -6,7 +6,6 @@ */ #include "Props.h" -#include "PropsMapBuffer.h" #include #include @@ -48,4 +47,27 @@ void Props::setProp( } } +#ifdef ANDROID + +constexpr MapBuffer::Key PROPS_NATIVE_ID = 1; + +void Props::propsDiffMapBuffer( + Props const *oldPropsPtr, + MapBufferBuilder &builder) const { + // Call with default props if necessary + if (oldPropsPtr == nullptr) { + Props defaultProps{}; + propsDiffMapBuffer(&defaultProps, builder); + return; + } + + Props const &oldProps = *oldPropsPtr; + Props const &newProps = *this; + + if (oldProps.nativeId != newProps.nativeId) { + builder.putString(PROPS_NATIVE_ID, nativeId); + } +} +#endif + } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/react/renderer/core/PropsMapBuffer.cpp b/packages/react-native/ReactCommon/react/renderer/core/PropsMapBuffer.cpp deleted file mode 100644 index c4f8c1153b9..00000000000 --- a/packages/react-native/ReactCommon/react/renderer/core/PropsMapBuffer.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include "PropsMapBuffer.h" -#include "Props.h" - -#ifdef ANDROID - -namespace facebook::react { - -void Props::propsDiffMapBuffer( - Props const *oldPropsPtr, - MapBufferBuilder &builder) const { - // Call with default props if necessary - if (oldPropsPtr == nullptr) { - Props defaultProps{}; - propsDiffMapBuffer(&defaultProps, builder); - return; - } - - Props const &oldProps = *oldPropsPtr; - Props const &newProps = *this; - - if (oldProps.nativeId != newProps.nativeId) { - builder.putString(PROPS_NATIVE_ID, nativeId); - } -} - -} // namespace facebook::react -#endif diff --git a/packages/react-native/ReactCommon/react/renderer/core/PropsMapBuffer.h b/packages/react-native/ReactCommon/react/renderer/core/PropsMapBuffer.h deleted file mode 100644 index 66d1d97b610..00000000000 --- a/packages/react-native/ReactCommon/react/renderer/core/PropsMapBuffer.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#ifdef ANDROID - -#include -#include - -namespace facebook::react { - -constexpr MapBuffer::Key PROPS_MAX = 1; -constexpr MapBuffer::Key PROPS_NATIVE_ID = 1; - -} // namespace facebook::react - -#endif