diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm index a961b31b4ec..2319a9c0d6d 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm @@ -420,7 +420,7 @@ static Class getFallbackClassFromName(const char *name) __block id module = nil; - if ([moduleClass conformsToProtocol:@protocol(RCTTurboModule)]) { + if ([self _shouldCreateObjCModule:moduleClass]) { __weak __typeof(self) weakSelf = self; dispatch_block_t work = ^{ auto strongSelf = weakSelf; @@ -478,6 +478,15 @@ static Class getFallbackClassFromName(const char *name) return moduleHolder->getModule(); } +- (BOOL)_shouldCreateObjCModule:(Class)moduleClass +{ + if (RCTTurboModuleInteropEnabled()) { + return [moduleClass conformsToProtocol:@protocol(RCTBridgeModule)]; + } + + return [moduleClass conformsToProtocol:@protocol(RCTTurboModule)]; +} + /** * Given a NativeModule class, and its name, create and initialize it synchronously. *