diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 3b29780304d6..65c48ff28d22 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -84,7 +84,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( NSDictionary *initProps = updateInitialProps([self prepareInitialProps], fabricEnabled); - RCTAppSetupPrepareApp(application, enableTM); + RCTAppSetupPrepareApp(application, enableTM, *_reactNativeConfig); UIView *rootView; if (enableBridgeless) { diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h index d661fb4355c1..af14ba93b917 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h @@ -11,6 +11,8 @@ #ifdef __cplusplus +#import + #import #ifndef RCT_USE_HERMES @@ -44,11 +46,22 @@ std::unique_ptr RCTAppSetupJsExecutorFactory RCTBridge *bridge, const std::shared_ptr &runtimeScheduler); +/** + * Register features and experiments prior to app initialization. + */ +void RCTAppSetupPrepareApp( + UIApplication *application, + BOOL turboModuleEnabled, + const facebook::react::ReactNativeConfig &reactNativeConfig); + #endif // __cplusplus RCT_EXTERN_C_BEGIN -void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled); +[[deprecated("Use the 3-argument overload of RCTAppSetupPrepareApp instead")]] void RCTAppSetupPrepareApp( + UIApplication *application, + BOOL turboModuleEnabled); + UIView *RCTAppSetupDefaultRootView( RCTBridge *bridge, NSString *moduleName, diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm index 7e522f9742bb..68b1f4179954 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm @@ -24,6 +24,9 @@ #import #import +// jsinspector-modern +#import + void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled) { RCTEnableTurboModule(turboModuleEnabled); @@ -35,6 +38,20 @@ void RCTAppSetupPrepareApp(UIApplication *application, BOOL turboModuleEnabled) #endif } +void RCTAppSetupPrepareApp( + UIApplication *application, + BOOL turboModuleEnabled, + const facebook::react::ReactNativeConfig &reactNativeConfig) +{ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + RCTAppSetupPrepareApp(application, turboModuleEnabled); +#pragma clang diagnostic pop + + auto &inspectorFlags = facebook::react::jsinspector_modern::InspectorFlags::getInstance(); + inspectorFlags.initFromConfig(reactNativeConfig); +} + UIView * RCTAppSetupDefaultRootView(RCTBridge *bridge, NSString *moduleName, NSDictionary *initialProperties, BOOL fabricEnabled) {