From 5e39bd6131be6fc68d39505ff6b47916a5bbee6e Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 3 Mar 2025 10:24:28 -0800 Subject: [PATCH] move initialisation of UIKit proxies to RCTHost initialisation (#49790) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49790 changelog: [internal] Reviewed By: cipolleschi Differential Revision: D70399708 fbshipit-source-id: f9883616377343f6c29eaa0ccee8681967fa570c --- .../react/runtime/platform/ios/ReactCommon/RCTHost.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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];