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. 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; }]; }); }); 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: 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