@@ -110,48 +110,46 @@ - (void)applicationDidEnterBackground:(UIApplication *)application
110
110
}
111
111
112
112
- (UIView *)viewWithModuleName : (NSString *)moduleName initialProperties : (NSDictionary *)initialProperties launchOptions : (NSDictionary *)launchOptions {
113
- BOOL fabricEnabled = self.fabricEnabled ;
114
- BOOL enableBridgeless = self.bridgelessEnabled ;
115
-
116
- NSDictionary *initProps = updateInitialProps (initialProperties, fabricEnabled);
113
+ BOOL fabricEnabled = self.fabricEnabled ;
114
+ BOOL enableBridgeless = self.bridgelessEnabled ;
115
+
116
+ NSDictionary *initProps = updateInitialProps (initialProperties, fabricEnabled);
117
+
118
+ UIView *rootView;
119
+ if (enableBridgeless) {
120
+ // Enable native view config interop only if both bridgeless mode and Fabric is enabled.
121
+ RCTSetUseNativeViewConfigsInBridgelessMode (self.fabricEnabled );
122
+
123
+ // Enable TurboModule interop by default in Bridgeless mode
124
+ RCTEnableTurboModuleInterop (YES );
125
+ RCTEnableTurboModuleInteropBridgeProxy (YES );
126
+
127
+ [self createReactHost ];
128
+ [RCTComponentViewFactory currentComponentViewFactory ].thirdPartyFabricComponentsProvider = self;
129
+ RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName: self .moduleName initialProperties: initProps];
130
+
131
+ RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc ]
132
+ initWithSurface: surface
133
+ sizeMeasureMode: RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
117
134
118
- UIView *rootView;
119
- if (enableBridgeless) {
120
- // Enable native view config interop only if both bridgeless mode and Fabric is enabled.
121
- RCTSetUseNativeViewConfigsInBridgelessMode (self.fabricEnabled );
122
-
123
- // Enable TurboModule interop by default in Bridgeless mode
124
- RCTEnableTurboModuleInterop (YES );
125
- RCTEnableTurboModuleInteropBridgeProxy (YES );
126
-
127
- [self createReactHost ];
128
- [RCTComponentViewFactory currentComponentViewFactory ].thirdPartyFabricComponentsProvider = self;
129
- RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName: self .moduleName initialProperties: initProps];
130
-
131
- RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc ]
132
- initWithSurface: surface
133
- sizeMeasureMode: RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
134
-
135
135
rootView = (RCTRootView *)surfaceHostingProxyRootView;
136
136
rootView.backgroundColor = [UIColor systemBackgroundColor ];
137
- } else {
138
- if (!self.bridge ) {
139
- self.bridge = [self createBridgeWithDelegate: self launchOptions: launchOptions];
140
- }
141
- if ([self newArchEnabled ]) {
142
- self.bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc ] initWithBridge: self .bridge
143
- contextContainer: _contextContainer];
144
- self.bridge .surfacePresenter = self.bridgeAdapter .surfacePresenter ;
145
-
146
- [RCTComponentViewFactory currentComponentViewFactory ].thirdPartyFabricComponentsProvider = self;
147
- }
148
- }
149
- rootView = [self createRootViewWithBridge: self .bridge moduleName: moduleName initProps: initProps];
150
- }
151
-
152
- [self customizeRootView: (RCTRootView *)rootView];
137
+ }
138
+ if (!self.bridge ) {
139
+ self.bridge = [self createBridgeWithDelegate: self launchOptions: launchOptions];
140
+ }
141
+ if ([self newArchEnabled ]) {
142
+ self.bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc ] initWithBridge: self .bridge
143
+ contextContainer: _contextContainer];
144
+ self.bridge .surfacePresenter = self.bridgeAdapter .surfacePresenter ;
153
145
154
- return rootView;
146
+ [RCTComponentViewFactory currentComponentViewFactory ].thirdPartyFabricComponentsProvider = self;
147
+ }
148
+ rootView = [self createRootViewWithBridge: self .bridge moduleName: moduleName initProps: initProps];
149
+
150
+ [self customizeRootView: (RCTRootView *)rootView];
151
+
152
+ return rootView;
155
153
}
156
154
157
155
- (NSURL *)sourceURLForBridge : (RCTBridge *)bridge
0 commit comments