diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h index c129391fa90b4a..ae20518aacd9da 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.h @@ -19,13 +19,13 @@ RCT_EXTERN void RCTTurboModuleSetBindingMode(facebook::react::TurboModuleBinding @protocol RCTTurboModuleManagerDelegate -@optional - /** - * Given a module name, return its actual class. If not provided, basic ObjC class lookup is performed. + * Given a module name, return its actual class. If nil is returned, basic ObjC class lookup is performed. */ - (Class)getModuleClassFromName:(const char *)name; +@optional + /** * Given a module class, provide an instance for it. If not provided, default initializer is used. */ 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 5d7e84f1446895..9b7e0148ef29d8 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 @@ -388,14 +388,11 @@ - (TurboModuleHolder *)_getOrCreateTurboModuleHolder:(const char *)moduleName /** * Step 2a: Resolve platform-specific class. */ - - if ([_delegate respondsToSelector:@selector(getModuleClassFromName:)]) { - if (RCTTurboModuleManagerDelegateLockingDisabled()) { - moduleClass = [_delegate getModuleClassFromName:moduleName]; - } else { - std::lock_guard delegateGuard(_turboModuleManagerDelegateMutex); - moduleClass = [_delegate getModuleClassFromName:moduleName]; - } + if (RCTTurboModuleManagerDelegateLockingDisabled()) { + moduleClass = [_delegate getModuleClassFromName:moduleName]; + } else { + std::lock_guard delegateGuard(_turboModuleManagerDelegateMutex); + moduleClass = [_delegate getModuleClassFromName:moduleName]; } if (!moduleClass) {