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
6 changes: 6 additions & 0 deletions .changeset/warm-drinks-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rnx-kit/react-native-host": patch
---

`[RCTBridge initWithDelegate:launchOptions:]` and `RCTEnableTurboModule()` were
removed in 0.89.
14 changes: 11 additions & 3 deletions packages/react-native-host/cocoa/ReactNativeHost.mm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ - (instancetype)initWithConfig:(id<RNXHostConfig>)config launchOptions:(NSDictio

- (RCTBridge *)bridge
{
#ifdef RCT_REMOVE_LEGACY_ARCH
return nil;
#else // RCT_REMOVE_LEGACY_ARCH
if (self.isBridgelessEnabled) {
return nil;
}
Expand All @@ -129,6 +132,7 @@ - (RCTBridge *)bridge
} @finally {
[_isShuttingDown unlock];
}
#endif // RCT_REMOVE_LEGACY_ARCH
}

- (RCTHost *)reactHost
Expand Down Expand Up @@ -253,22 +257,26 @@ - (void)didCreateContextContainer:

- (BOOL)isBridgelessEnabled
{
#if USE_BRIDGELESS
#ifdef RCT_REMOVE_LEGACY_ARCH
return YES;
#elif USE_BRIDGELESS
// Bridgeless mode is enabled if it was turned on with a build flag, unless
// `isBridgelessEnabled` is explicitly implemented and returns false.
return ![_config respondsToSelector:@selector(isBridgelessEnabled)] ||
[_config isBridgelessEnabled];
#else
return NO;
#endif // USE_BRIDGELESS
#endif // RCT_REMOVE_LEGACY_ARCH
}

- (void)enableTurboModule
{
#if USE_FABRIC
_turboModuleAdapter = [[RNXTurboModuleAdapter alloc] init];
#ifndef RCT_REMOVE_LEGACY_ARCH
RCTEnableTurboModule(true);
#endif
#endif // !RCT_REMOVE_LEGACY_ARCH
#endif // USE_FABRIC
}

- (void)initializeReactHost
Expand Down
Loading