From fedceecc3731e387e531d3aaa170eba1914f5a9e Mon Sep 17 00:00:00 2001 From: Cao Doan Date: Tue, 24 Jun 2025 15:38:23 -0700 Subject: [PATCH] Correct some cpp imports (#52212) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52212 Correcting some C++ imports that show up when build with Xcode 26: - Missing `` imports. - `` is a deprecated C++ header file, which in this case can be substituted with ``. ## Changelog: [Internal] [iOS][Fixed] - Fix deprecated C++ imports Reviewed By: zhenma Differential Revision: D77192276 fbshipit-source-id: 30c836947cb3eb54f6e7ac42b87fd2493334a4f4 --- .../ios/RCTSampleNativeComponentViewManager.mm | 2 ++ .../Libraries/Image/RCTImageURLLoaderWithAttribution.h | 3 ++- packages/react-native/Libraries/Image/RCTImageUtils.mm | 2 +- packages/react-native/React/Base/RCTUtils.h | 2 -- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/react-native-test-library/ios/RCTSampleNativeComponentViewManager.mm b/packages/react-native-test-library/ios/RCTSampleNativeComponentViewManager.mm index ffe7c6c9e01..80981260209 100644 --- a/packages/react-native-test-library/ios/RCTSampleNativeComponentViewManager.mm +++ b/packages/react-native-test-library/ios/RCTSampleNativeComponentViewManager.mm @@ -9,6 +9,8 @@ #import #import +#import + static UIColor *UIColorFromHexString(const std::string hexString) { unsigned rgbValue = 0; diff --git a/packages/react-native/Libraries/Image/RCTImageURLLoaderWithAttribution.h b/packages/react-native/Libraries/Image/RCTImageURLLoaderWithAttribution.h index 87b59f0843c..59213fa62c9 100644 --- a/packages/react-native/Libraries/Image/RCTImageURLLoaderWithAttribution.h +++ b/packages/react-native/Libraries/Image/RCTImageURLLoaderWithAttribution.h @@ -8,9 +8,10 @@ #import #import #import - // TODO (T61325135): Remove C++ checks #ifdef __cplusplus +#import + namespace facebook::react { struct ImageURLLoaderAttribution { diff --git a/packages/react-native/Libraries/Image/RCTImageUtils.mm b/packages/react-native/Libraries/Image/RCTImageUtils.mm index b7f85f83fc3..af0d12d5d17 100644 --- a/packages/react-native/Libraries/Image/RCTImageUtils.mm +++ b/packages/react-native/Libraries/Image/RCTImageUtils.mm @@ -7,7 +7,7 @@ #import -#import +#import #import #import diff --git a/packages/react-native/React/Base/RCTUtils.h b/packages/react-native/React/Base/RCTUtils.h index d4459badcea..1f3c29b0062 100644 --- a/packages/react-native/React/Base/RCTUtils.h +++ b/packages/react-native/React/Base/RCTUtils.h @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -#import - #import #import #import