From ad116dad167784d2855aeefb6106961db7bbf8ba Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 11 May 2023 05:39:12 -0700 Subject: [PATCH] Back out "Allow the TurboModule system to create legacy modules" Summary: Original commit changeset: be6f054556d1 Original Phabricator Diff: D45706884 ## Changelog: [iOS][Fixed] - Revert [TM][iOS] Allow the TurboModule system to create legacy modules Reviewed By: jacdebug Differential Revision: D45773198 fbshipit-source-id: ba6b6c136e74fde53af5c014d8223c4c7d1509db --- .../platform/ios/ReactCommon/RCTTurboModuleManager.mm | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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 2319a9c0d6d..a961b31b4ec 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 ([self _shouldCreateObjCModule:moduleClass]) { + if ([moduleClass conformsToProtocol:@protocol(RCTTurboModule)]) { __weak __typeof(self) weakSelf = self; dispatch_block_t work = ^{ auto strongSelf = weakSelf; @@ -478,15 +478,6 @@ 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. *