From 9e235fd7a68950548a6a8722519e5ce834025933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwa=C5=9Bniewski?= Date: Thu, 29 Feb 2024 12:49:37 +0100 Subject: [PATCH] fix: use clearColor instead of systemBackgroundColor for visionOS (#125) --- packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 04bd3792ba33a3..a154b2c094dabc 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -113,7 +113,11 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName initialProperties:(NSDicti sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact]; rootView = (RCTRootView *)surfaceHostingProxyRootView; +#if TARGET_OS_VISION + rootView.backgroundColor = [UIColor clearColor]; +#else rootView.backgroundColor = [UIColor systemBackgroundColor]; +#endif [self customizeRootView:(RCTRootView *)rootView]; return rootView; }