diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm index 4b687c5a3e0f92..a92596cb67cc9c 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm @@ -26,7 +26,6 @@ #import #import #import -#import #if USE_HERMES #import #else @@ -35,7 +34,6 @@ #import #import #import -#import #import #import #import @@ -99,13 +97,8 @@ - (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock @end -@interface RCTRootViewFactory () { - std::shared_ptr _reactNativeConfig; - facebook::react::ContextContainer::Shared _contextContainer; -} -@end - @interface RCTRootViewFactory () { + facebook::react::ContextContainer::Shared _contextContainer; std::shared_ptr _runtimeScheduler; } @end @@ -124,8 +117,6 @@ - (instancetype)initWithTurboModuleDelegate:(id)t _configuration = configuration; _hostDelegate = hostdelegate; _contextContainer = std::make_shared(); - _reactNativeConfig = std::make_shared(); - _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); _turboModuleManagerDelegate = turboModuleManagerDelegate; } return self; @@ -281,7 +272,6 @@ - (RCTHost *)createReactHost:(NSDictionary *)launchOptions [reactHost setBundleURLProvider:^NSURL *() { return [weakSelf bundleURL]; }]; - [reactHost setContextContainerHandler:self]; [reactHost start]; return reactHost; } @@ -289,18 +279,12 @@ - (RCTHost *)createReactHost:(NSDictionary *)launchOptions - (std::shared_ptr)createJSRuntimeFactory { #if USE_HERMES - return std::make_shared( - _reactNativeConfig, nullptr, /* allocInOldGenBeforeTTI */ false); + return std::make_shared(nullptr, nullptr, /* allocInOldGenBeforeTTI */ false); #else return std::make_shared(); #endif } -- (void)didCreateContextContainer:(std::shared_ptr)contextContainer -{ - contextContainer->insert("ReactNativeConfig", _reactNativeConfig); -} - - (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge { if (_configuration.extraModulesForBridge != nil) { diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp index 27976b921bad60..9cda709a4f2fbd 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/FabricUIManagerBinding.cpp @@ -473,7 +473,6 @@ void FabricUIManagerBinding::installFabricUIManager( globalJavaUiManager); }; - contextContainer->insert("ReactNativeConfig", config); contextContainer->insert("FabricUIManager", globalJavaUiManager); // Keep reference to config object and cache some feature flags here