diff --git a/packages/react-native/Libraries/Text/React-RCTText.podspec b/packages/react-native/Libraries/Text/React-RCTText.podspec index 103e930b373440..0443c79b9dea3d 100644 --- a/packages/react-native/Libraries/Text/React-RCTText.podspec +++ b/packages/react-native/Libraries/Text/React-RCTText.podspec @@ -28,6 +28,7 @@ Pod::Spec.new do |s| s.source = source s.source_files = "**/*.{h,m,mm}" s.ios.exclude_files = "**/macOS/*" # [macOS] + s.visionos.exclude_files = "**/macOS/*" # [visionOS] s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" s.header_dir = "RCTText" # [macOS MobileCoreServices Not available on macOS diff --git a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm index 3a784faf3716aa..deade21a02bcd5 100644 --- a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm +++ b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm @@ -68,17 +68,18 @@ - (void)initialize _currentInterfaceDimensions = [self _exportedDimensions]; -#if !TARGET_OS_OSX // [macOS] +#if TARGET_OS_IOS // [macOS] [visionOS] [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interfaceOrientationDidChange) name:UIApplicationDidBecomeActiveNotification object:nil]; +#endif // [macOS] [visionOS] [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interfaceFrameDidChange) name:RCTUserInterfaceStyleDidChangeNotification object:nil]; -#endif // [macOS] + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interfaceFrameDidChange) name:RCTRootViewFrameDidChangeNotification