From dca2b8fb9ed1796a002a3633d4824e5c84196346 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Sun, 10 May 2026 16:40:16 -0700 Subject: [PATCH 1/4] fix(react-native-host): rename inner strongSelf to fix -Wshadow The inner block in -setBridge: redeclares strongSelf, shadowing the outer strongSelf captured for the RCTExecuteOnMainQueue scope. With -Wshadow on this is a -Werror. Rename the inner reference to innerStrongSelf so it no longer shadows the outer. --- packages/react-native-host/cocoa/RNXHostReleaser.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native-host/cocoa/RNXHostReleaser.mm b/packages/react-native-host/cocoa/RNXHostReleaser.mm index 2569e47f44..6edede7160 100644 --- a/packages/react-native-host/cocoa/RNXHostReleaser.mm +++ b/packages/react-native-host/cocoa/RNXHostReleaser.mm @@ -50,12 +50,12 @@ - (void)setBridge:(__weak RCTBridge *)bridge RCTExecuteOnUIManagerQueue(^{ [manager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) { - __typeof(self) strongSelf = weakSelf; - if (strongSelf == nil) { + __typeof(self) innerStrongSelf = weakSelf; + if (innerStrongSelf == nil) { return; } - strongSelf->_viewRegistry = viewRegistry; + innerStrongSelf->_viewRegistry = viewRegistry; }]; }); }); From 7d4db68262be70addbd6888d0ce98e6259a4cb24 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 18 May 2026 12:27:02 -0700 Subject: [PATCH 2/4] fix(react-native-host): gate RCTCxxBridgeDelegate.h import behind USE_BRIDGELESS The protocol conformance on ReactNativeHost is already conditional (`` when USE_BRIDGELESS=1, otherwise ``), but the `#import ` above it is unconditional. Consumers that don't expose that header in their USE_BRIDGELESS=1 React-Core surface fail to compile. Gate the import the same way the conformance is gated so the header is only required when it is actually used. --- packages/react-native-host/cocoa/ReactNativeHost.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native-host/cocoa/ReactNativeHost.mm b/packages/react-native-host/cocoa/ReactNativeHost.mm index 677b9e8a38..72b71c3d07 100644 --- a/packages/react-native-host/cocoa/ReactNativeHost.mm +++ b/packages/react-native-host/cocoa/ReactNativeHost.mm @@ -6,7 +6,6 @@ #import #import -#import #import #import @@ -17,6 +16,10 @@ #import "RNXHostReleaser.h" #import "RNXTurboModuleAdapter.h" +#if !USE_BRIDGELESS +#import +#endif // !USE_BRIDGELESS + @class RCTSurfacePresenter; #ifdef USE_REACT_NATIVE_CONFIG From 2015860faf7d7f7c5f21a2109fcf5e3b606679ac Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 18 May 2026 12:27:29 -0700 Subject: [PATCH 3/4] fix(react-native-host): drop stray semicolon before -viewWithModuleName: body The semicolon between the method declarator and the body of `-viewWithModuleName:initialProperties:` is flagged by `-Wsemicolon-before-method-body`. With `-Werror` on, this is a build failure under stricter xcconfigs. --- packages/react-native-host/cocoa/ReactNativeHost+View.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-host/cocoa/ReactNativeHost+View.mm b/packages/react-native-host/cocoa/ReactNativeHost+View.mm index 21254fe4be..6c416d8bb4 100644 --- a/packages/react-native-host/cocoa/ReactNativeHost+View.mm +++ b/packages/react-native-host/cocoa/ReactNativeHost+View.mm @@ -41,7 +41,7 @@ + (instancetype)hostFromRootView:(RNXView *)rootView } - (RNXView *)viewWithModuleName:(NSString *)moduleName - initialProperties:(NSDictionary *)initialProperties; + initialProperties:(NSDictionary *)initialProperties { #ifdef USE_FABRIC // Having `concurrentRoot` disabled when Fabric is enabled is not recommended: From d77bba7f311509da9f9c1618cb2cd5ba5d61db90 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Mon, 18 May 2026 12:34:35 -0700 Subject: [PATCH 4/4] docs(changeset): build cleanly under stricter Office xcconfigs --- .changeset/react-native-host-strict-xcconfig.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .changeset/react-native-host-strict-xcconfig.md diff --git a/.changeset/react-native-host-strict-xcconfig.md b/.changeset/react-native-host-strict-xcconfig.md new file mode 100644 index 0000000000..9c94346d83 --- /dev/null +++ b/.changeset/react-native-host-strict-xcconfig.md @@ -0,0 +1,12 @@ +--- +"@rnx-kit/react-native-host": patch +--- + +fix(react-native-host): Various build fixes + +- Rename inner `strongSelf` in `-setBridge:` to `innerStrongSelf` so it + no longer shadows the outer. +- Gate `#import ` behind `#if !USE_BRIDGELESS` + to match the already-conditional protocol conformance. +- Drop the stray `;` before the `-viewWithModuleName:initialProperties:` + body.