Skip to content

Commit 53472b7

Browse files
rmevans9kelset
authored andcommitted
SafeAreaView - Fix for Web usage (react-navigation#2950)
1 parent 6e4afe2 commit 53472b7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/views/SafeAreaView.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
} from 'react-native';
1212
import withOrientation from './withOrientation';
1313

14-
const { isIPhoneX_deprecated } = DeviceInfo;
1514
// See https://mydevice.io/devices/ for device dimensions
1615
const X_WIDTH = 375;
1716
const X_HEIGHT = 812;
@@ -24,8 +23,10 @@ const { PlatformConstants = {} } = NativeModules;
2423
const { minor = 0 } = PlatformConstants.reactNativeVersion || {};
2524

2625
const isIPhoneX = (() => {
26+
if (Platform.OS === 'web') return false;
27+
2728
if (minor >= 50) {
28-
return isIPhoneX_deprecated;
29+
return DeviceInfo.isIPhoneX_deprecated;
2930
}
3031

3132
return (

0 commit comments

Comments
 (0)