diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm index a92596cb67cc..d0f5379c919d 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm @@ -38,17 +38,6 @@ #import #import -static NSString *const kRNConcurrentRoot = @"concurrentRoot"; - -static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabricEnabled) -{ - NSMutableDictionary *mutableProps = initialProps != NULL ? [initialProps mutableCopy] : [NSMutableDictionary new]; - // Hardcoding the Concurrent Root as it it not recommended to - // have the concurrentRoot turned off when Fabric is enabled. - mutableProps[kRNConcurrentRoot] = @(isFabricEnabled); - return mutableProps; -} - @implementation RCTRootViewFactoryConfiguration - (instancetype)initWithBundleURL:(NSURL *)bundleURL newArchEnabled:(BOOL)newArchEnabled @@ -149,11 +138,9 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName } - (UIView *)viewWithModuleName:(NSString *)moduleName - initialProperties:(NSDictionary *)initialProperties + initialProperties:(NSDictionary *)initProps launchOptions:(NSDictionary *)launchOptions { - NSDictionary *initProps = updateInitialProps(initialProperties, _configuration.fabricEnabled); - if (_configuration.bridgelessEnabled) { // Enable TurboModule interop by default in Bridgeless mode RCTEnableTurboModuleInterop(YES); @@ -167,8 +154,8 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface]; surfaceHostingProxyRootView.backgroundColor = [UIColor systemBackgroundColor]; - if (self->_configuration.customizeRootView != nil) { - self->_configuration.customizeRootView(surfaceHostingProxyRootView); + if (_configuration.customizeRootView != nil) { + _configuration.customizeRootView(surfaceHostingProxyRootView); } return surfaceHostingProxyRootView; } @@ -182,8 +169,8 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName } else { rootView = [self createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps]; } - if (self->_configuration.customizeRootView != nil) { - self->_configuration.customizeRootView(rootView); + if (_configuration.customizeRootView != nil) { + _configuration.customizeRootView(rootView); } return rootView; } @@ -197,11 +184,9 @@ - (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initProps:(NSDictionary *)initProps { - BOOL enableFabric = self->_configuration.fabricEnabled; + BOOL enableFabric = _configuration.fabricEnabled; UIView *rootView = RCTAppSetupDefaultRootView(bridge, moduleName, initProps, enableFabric); - rootView.backgroundColor = [UIColor systemBackgroundColor]; - return rootView; } diff --git a/packages/react-native/Libraries/ReactNative/AppRegistry.js b/packages/react-native/Libraries/ReactNative/AppRegistry.js index 79e2bdc97d50..6c18c8d6170a 100644 --- a/packages/react-native/Libraries/ReactNative/AppRegistry.js +++ b/packages/react-native/Libraries/ReactNative/AppRegistry.js @@ -46,7 +46,6 @@ type AppParameters = { initialProps: $ReadOnly<{[string]: mixed, ...}>, rootTag: RootTag, fabric?: boolean, - concurrentRoot?: boolean, }; export type Runnable = ( appParameters: AppParameters, @@ -120,10 +119,6 @@ const AppRegistry = { ): string { const scopedPerformanceLogger = createPerformanceLogger(); runnables[appKey] = (appParameters, displayMode) => { - const concurrentRootEnabled = Boolean( - appParameters.initialProps?.concurrentRoot || - appParameters.concurrentRoot, - ); renderApplication( componentProviderInstrumentationHook( componentProvider, @@ -138,7 +133,6 @@ const AppRegistry = { appKey === 'LogBox', // is logbox appKey, displayMode, - concurrentRootEnabled, ); }; if (section) { diff --git a/packages/react-native/Libraries/ReactNative/renderApplication.js b/packages/react-native/Libraries/ReactNative/renderApplication.js index 782014a52dd5..de0f46108e35 100644 --- a/packages/react-native/Libraries/ReactNative/renderApplication.js +++ b/packages/react-native/Libraries/ReactNative/renderApplication.js @@ -41,7 +41,6 @@ export default function renderApplication( isLogBox?: boolean, debugName?: string, displayMode?: ?DisplayModeType, - useConcurrentRoot?: boolean, useOffscreen?: boolean, ) { invariant(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag); @@ -87,12 +86,12 @@ export default function renderApplication( } // We want to have concurrentRoot always enabled when you're on Fabric. - const useConcurrentRootOverride = fabric; + const useConcurrentRoot = Boolean(fabric); performanceLogger.startTimespan('renderApplication_React_render'); performanceLogger.setExtra( 'usedReactConcurrentRoot', - useConcurrentRootOverride ? '1' : '0', + useConcurrentRoot ? '1' : '0', ); performanceLogger.setExtra('usedReactFabric', fabric ? '1' : '0'); performanceLogger.setExtra( @@ -103,7 +102,7 @@ export default function renderApplication( element: renderable, rootTag, useFabric: Boolean(fabric), - useConcurrentRoot: Boolean(useConcurrentRootOverride), + useConcurrentRoot, }); performanceLogger.stopTimespan('renderApplication_React_render'); } diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index d6551c65fc20..3ed00b8adcaf 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -7381,7 +7381,6 @@ type AppParameters = { initialProps: $ReadOnly<{ [string]: mixed, ... }>, rootTag: RootTag, fabric?: boolean, - concurrentRoot?: boolean, }; export type Runnable = ( appParameters: AppParameters, @@ -7741,7 +7740,6 @@ exports[`public API should not change unintentionally Libraries/ReactNative/rend isLogBox?: boolean, debugName?: string, displayMode?: ?DisplayModeType, - useConcurrentRoot?: boolean, useOffscreen?: boolean ): void; "