diff --git a/RNTester/RNTester/AppDelegate.mm b/RNTester/RNTester/AppDelegate.mm index c8f14cad8e1efa..a6898762311470 100644 --- a/RNTester/RNTester/AppDelegate.mm +++ b/RNTester/RNTester/AppDelegate.mm @@ -30,7 +30,10 @@ #ifdef RN_FABRIC_ENABLED #import +#import #import + +#import #endif @@ -53,7 +56,9 @@ @interface AppDelegate() { #ifdef RN_FABRIC_ENABLED - RCTSurfacePresenter *_surfacePresenter; + RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; + std::shared_ptr _reactNativeConfig; + facebook::react::ContextContainer::Shared _contextContainer; #endif RCTTurboModuleManager *_turboModuleManager; @@ -77,14 +82,15 @@ - (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWith } #ifdef RN_FABRIC_ENABLED - _surfacePresenter = [[RCTSurfacePresenter alloc] initWithBridge:_bridge - config:nil - imageLoader:RCTTurboModuleEnabled() ? - [_bridge moduleForName:@"RCTImageLoader" - lazilyLoadIfNecessary:YES] : nil - runtimeExecutor:nullptr]; - - _bridge.surfacePresenter = _surfacePresenter; + _contextContainer = std::make_shared(); + _reactNativeConfig = std::make_shared(); + + _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); + + _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:_bridge + contextContainer:_contextContainer]; + + _bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; UIView *rootView = [[RCTFabricSurfaceHostingProxyRootView alloc] initWithBridge:_bridge moduleName:@"RNTesterApp" initialProperties:initProps]; #else