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 ff8810cba40..bc8c2bab4d9 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm @@ -62,7 +62,7 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations { UIInterfaceOrientationMask appSupportedOrientationsMask = - [RCTSharedApplication() supportedInterfaceOrientationsForWindow:[RCTSharedApplication() keyWindow]]; + [RCTSharedApplication() supportedInterfaceOrientationsForWindow:RCTKeyWindow()]; if (!(_supportedInterfaceOrientations & appSupportedOrientationsMask)) { RCTLogError( @"Modal was presented with 0x%x orientations mask but the application only supports 0x%x." diff --git a/packages/react-native/React/Views/RCTModalHostViewController.m b/packages/react-native/React/Views/RCTModalHostViewController.m index 50075ffd484..38629cf2eb1 100644 --- a/packages/react-native/React/Views/RCTModalHostViewController.m +++ b/packages/react-native/React/Views/RCTModalHostViewController.m @@ -54,7 +54,7 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations { UIInterfaceOrientationMask appSupportedOrientationsMask = - [RCTSharedApplication() supportedInterfaceOrientationsForWindow:[RCTSharedApplication() keyWindow]]; + [RCTSharedApplication() supportedInterfaceOrientationsForWindow:RCTKeyWindow()]; if (!(_supportedInterfaceOrientations & appSupportedOrientationsMask)) { RCTLogError( @"Modal was presented with 0x%x orientations mask but the application only supports 0x%x."