diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm index 24616334d34..8f6f7f3a466 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm @@ -22,6 +22,7 @@ #import #import #import +#import #import #import #import @@ -190,9 +191,10 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho andSetter:bundleURLSetter andDefaultGetter:defaultBundleURLGetter]; - // Listen to reload commands - dispatch_async(dispatch_get_main_queue(), ^{ + RCTExecuteOnMainQueue(^{ + // Listen to reload commands RCTRegisterReloadCommandListener(self); + RCTInitializeUIKitProxies(); }); _inspectorHostDelegate = std::make_unique(self); @@ -249,7 +251,6 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho mode:(DisplayMode)displayMode initialProperties:(NSDictionary *)properties { - RCTInitializeUIKitProxies(); RCTFabricSurface *surface = [[RCTFabricSurface alloc] initWithSurfacePresenter:self.surfacePresenter moduleName:moduleName initialProperties:properties];