diff --git a/packages/react-native/React/Base/RCTUtils.m b/packages/react-native/React/Base/RCTUtils.m index d0d09bdb74a01f..d788e68d0ae6b3 100644 --- a/packages/react-native/React/Base/RCTUtils.m +++ b/packages/react-native/React/Base/RCTUtils.m @@ -301,23 +301,17 @@ static void RCTUnsafeExecuteOnMainQueueOnceSync(dispatch_once_t *onceToken, disp void RCTComputeScreenScale(void) { -#if !TARGET_OS_VISION dispatch_once(&onceTokenScreenScale, ^{ screenScale = [UITraitCollection currentTraitCollection].displayScale; }); -#endif } CGFloat RCTScreenScale(void) { -#if !TARGET_OS_VISION RCTUnsafeExecuteOnMainQueueOnceSync(&onceTokenScreenScale, ^{ screenScale = [UITraitCollection currentTraitCollection].displayScale; }); return screenScale; -#endif - - return 2; } CGFloat RCTFontSizeMultiplier(void) diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm index f0881fd9541628..8ffafb6dc3b997 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm @@ -42,14 +42,12 @@ - (void)loadView [_touchHandler attachToView:self.view]; } +#if !TARGET_OS_VISION - (UIStatusBarStyle)preferredStatusBarStyle { -#if !TARGET_OS_VISION - return [RCTSharedApplication() statusBarStyle]; -#else - return UIStatusBarStyleDefault; -#endif + return UIStatusBarStyleDefault; } +#endif - (void)viewDidDisappear:(BOOL)animated { @@ -57,14 +55,12 @@ - (void)viewDidDisappear:(BOOL)animated _lastViewBounds = CGRectZero; } +#if !TARGET_OS_VISION - (BOOL)prefersStatusBarHidden { -#if !TARGET_OS_VISION return [RCTSharedApplication() isStatusBarHidden]; -#else - return false; -#endif } +#endif #if RCT_DEV - (UIInterfaceOrientationMask)supportedInterfaceOrientations diff --git a/packages/react-native/React/UIUtils/RCTUIUtils.m b/packages/react-native/React/UIUtils/RCTUIUtils.m index 6f706d9d6ebd2e..423636b3732a8d 100644 --- a/packages/react-native/React/UIUtils/RCTUIUtils.m +++ b/packages/react-native/React/UIUtils/RCTUIUtils.m @@ -22,7 +22,7 @@ RCTDimensions RCTGetDimensions(CGFloat fontScale) CGSize windowSize = mainWindow ? mainWindow.bounds.size : screenSize; CGFloat scale; #if TARGET_OS_VISION - scale = 2; + scale = [UITraitCollection currentTraitCollection].displayScale; #else scale = mainScreen.scale; #endif diff --git a/packages/react-native/React/Views/RCTModalHostView.m b/packages/react-native/React/Views/RCTModalHostView.m index 9694d67e8e1d0b..f9b0c2c39e2eba 100644 --- a/packages/react-native/React/Views/RCTModalHostView.m +++ b/packages/react-native/React/Views/RCTModalHostView.m @@ -78,7 +78,7 @@ - (void)notifyForOrientationChange #if !TARGET_OS_VISION UIInterfaceOrientation currentOrientation = [RCTSharedApplication() statusBarOrientation]; #else - UIInterfaceOrientation currentOrientation = UIDeviceOrientationUnknown; + UIInterfaceOrientation currentOrientation = UIInterfaceOrientationUnknown; #endif if (currentOrientation == _lastKnownOrientation) { return;