From 42340dc2162f2653389bd3e4acc7459813bb52bd Mon Sep 17 00:00:00 2001 From: Devan Buggay Date: Tue, 13 Jan 2026 16:09:38 -0800 Subject: [PATCH] Replace systemBackgroundColor for AppleTV (#55131) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55131 [UIColor systemBackgroundColor] is unavailable on AppleTV, defaulting to [UIColor clearColor]. Changelog: [internal] Reviewed By: Abbondanzo Differential Revision: D90514013 fbshipit-source-id: 51f53bc273fe4e544695299fb9acf1131db1ee47 --- .../AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm | 4 ++++ .../Libraries/AppDelegate/RCTRootViewFactory.mm | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm index 3b917c1a05c..f780a891127 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm @@ -59,7 +59,11 @@ { UIView *rootView = RCTAppSetupDefaultRootView(bridge, moduleName, initProps, YES); +#if TARGET_OS_TV + rootView.backgroundColor = [UIColor clearColor]; +#else rootView.backgroundColor = [UIColor systemBackgroundColor]; +#endif return rootView; } diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm index 266d6bab211..55b0a269848 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm @@ -190,7 +190,11 @@ RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface]; +#if TARGET_OS_TV + surfaceHostingProxyRootView.backgroundColor = [UIColor clearColor]; +#else surfaceHostingProxyRootView.backgroundColor = [UIColor systemBackgroundColor]; +#endif if (_configuration.customizeRootView != nil) { _configuration.customizeRootView(surfaceHostingProxyRootView); } @@ -207,7 +211,11 @@ initProps:(NSDictionary *)initProps { UIView *rootView = RCTAppSetupDefaultRootView(bridge, moduleName, initProps, YES); +#if !TARGET_OS_TV rootView.backgroundColor = [UIColor systemBackgroundColor]; +#else + rootView.backgroundColor = [UIColor blackColor]; +#endif return rootView; }