Skip to content

Commit

Permalink
Fixes root view's background color in bridgeless mode (#42739)
Browse files Browse the repository at this point in the history
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: #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
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Jan 31, 2024
1 parent 8fca1c5 commit 0bbc311
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 0bbc311

Please sign in to comment.