From 0bbc311c8ac45577c5ba5a58443380621e807faf Mon Sep 17 00:00:00 2001 From: zhongwuzw Date: Wed, 31 Jan 2024 03:25:24 -0800 Subject: [PATCH] Fixes root view's background color in bridgeless mode (#42739) Summary: Fixes root view's background color in bridgeless mode, the top area has white background color when in dark mode. Before: ![Simulator Screenshot - iPhone 15 - 2024-01-30 at 23 28 48](https://github.com/facebook/react-native/assets/5061845/4359385d-370d-48cf-a58e-e2e9eb871400) After: ![Simulator Screenshot - iPhone 15 - 2024-01-30 at 23 25 39](https://github.com/facebook/react-native/assets/5061845/5e9d2029-43d2-40c3-b2cb-c8a9ee80a5e1) ## Changelog: [IOS] [FIXED] - [iOS] Fixes the root view's background color in bridgeless mode Pull Request resolved: https://github.com/facebook/react-native/pull/42739 Test Plan: Run RNTester and see the top area's background color. Reviewed By: cortinico Differential Revision: D53263621 Pulled By: javache fbshipit-source-id: f18128464c9171ba8e0f6858c0608ce757349d27 --- packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 136735e6edf4e4..718f8ca5f8325f 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -107,6 +107,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact]; rootView = (RCTRootView *)surfaceHostingProxyRootView; + rootView.backgroundColor = [UIColor systemBackgroundColor]; } else { if (!self.bridge) { self.bridge = [self createBridgeWithDelegate:self launchOptions:launchOptions];