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
This commit is contained in:
Devan Buggay authored and meta-codesync[bot] committed 2026-01-13 16:09:38 -08:00
1 parent 53ab483080
commit 42340dc216
2 files changed
+12

No files matched your search

@@ -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;
}
@@ -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;
}