diff --git a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm index 454a3252cc5e..648504cd1a2b 100644 --- a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm +++ b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm @@ -128,7 +128,10 @@ static BOOL RCTIsIPhoneNotched() RCTAssertMainQueue(); // 20pt is the top safeArea value in non-notched devices - isIPhoneNotched = RCTSharedApplication().keyWindow.safeAreaInsets.top > 20; + UIWindow *keyWindow = RCTKeyWindow(); + if (keyWindow) { + isIPhoneNotched = keyWindow.safeAreaInsets.top > 20; + } }); #endif