diff --git a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm index c5a46e004d8..8553041e814 100644 --- a/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm +++ b/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm @@ -17,6 +17,7 @@ #import #import #import +#import #import #import @@ -326,7 +327,14 @@ static Class getFallbackClassFromName(const char *name) if ([[module class] respondsToSelector:@selector(requiresMainQueueSetup)] && [[module class] requiresMainQueueSetup]) { - dispatch_async(dispatch_get_main_queue(), setupTurboModule); + /** + * If the main thread synchronously calls into JS that creates a TurboModule, + * we could deadlock. This behaviour is migrated over from the legacy NativeModule + * system. + * + * TODO(T63807674): Investigate the right migration plan off of this + */ + RCTUnsafeExecuteOnMainQueueSync(setupTurboModule); } else { setupTurboModule(); }