diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h b/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h index 80d61ff89d0..0e6efef455c 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +++ b/packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h @@ -26,7 +26,9 @@ struct Color { Color(int32_t color); Color(const DynamicColor &dynamicColor); Color(const ColorComponents &components); - Color() : uiColor_(nullptr) {}; + // constexpr so `UndefinedColor` below is constant-initialized instead of + // emitting a static initializer in every translation unit that includes it. + constexpr Color() : uiColor_(nullptr), uiColorHashValue_(0) {}; int32_t getColor() const; std::size_t getUIColorHash() const; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index adcf6293970..2e990d9c530 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -5325,7 +5325,7 @@ struct facebook::react::Bridging { } struct facebook::react::Color { - public Color(); + public constexpr Color(); public Color(const facebook::react::ColorComponents& components); public Color(const facebook::react::DynamicColor& dynamicColor); public Color(int32_t color); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index 2cb413c7e92..75062b3527d 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -8150,7 +8150,7 @@ struct facebook::react::CallbackWithId { } struct facebook::react::Color { - public Color(); + public constexpr Color(); public Color(const facebook::react::ColorComponents& components); public Color(const facebook::react::DynamicColor& dynamicColor); public Color(int32_t color); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 273b4a58578..2badec9926e 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -5310,7 +5310,7 @@ struct facebook::react::Bridging { } struct facebook::react::Color { - public Color(); + public constexpr Color(); public Color(const facebook::react::ColorComponents& components); public Color(const facebook::react::DynamicColor& dynamicColor); public Color(int32_t color); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 3be7fbb556a..05276aaff02 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -5318,7 +5318,7 @@ struct facebook::react::Bridging { } struct facebook::react::Color { - public Color(); + public constexpr Color(); public Color(const facebook::react::ColorComponents& components); public Color(const facebook::react::DynamicColor& dynamicColor); public Color(int32_t color);