Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/react-native-host-strict-xcconfig.md
Original file line number Diff line number Diff line change
@@ -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 <React/RCTCxxBridgeDelegate.h>` behind `#if !USE_BRIDGELESS`
to match the already-conditional protocol conformance.
- Drop the stray `;` before the `-viewWithModuleName:initialProperties:`
body.
6 changes: 3 additions & 3 deletions packages/react-native-host/cocoa/RNXHostReleaser.mm
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ - (void)setBridge:(__weak RCTBridge *)bridge
RCTExecuteOnUIManagerQueue(^{
[manager addUIBlock:^(RCTUIManager *uiManager,
NSDictionary<NSNumber *, UIView *> *viewRegistry) {
__typeof(self) strongSelf = weakSelf;
if (strongSelf == nil) {
__typeof(self) innerStrongSelf = weakSelf;
if (innerStrongSelf == nil) {
return;
}

strongSelf->_viewRegistry = viewRegistry;
innerStrongSelf->_viewRegistry = viewRegistry;
}];
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-host/cocoa/ReactNativeHost+View.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion packages/react-native-host/cocoa/ReactNativeHost.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTDevLoadingViewSetEnabled.h>
#import <React/RCTUtils.h>

Expand All @@ -17,6 +16,10 @@
#import "RNXHostReleaser.h"
#import "RNXTurboModuleAdapter.h"

#if !USE_BRIDGELESS
#import <React/RCTCxxBridgeDelegate.h>
#endif // !USE_BRIDGELESS

@class RCTSurfacePresenter;

#ifdef USE_REACT_NATIVE_CONFIG
Expand Down
Loading