See: How to set iOS status bar background color in React Native?
- For an iPhone X, the increase StatusBarHeightIos from 20 to 30
- I use react-native-device-info to detect device
import DeviceInfo from 'react-native-device-info';
// getModel: iPhone X
// getDeviceId: iPhone10,3
const ModelIphoneX = 'iPhone X';
// StatusBarHeight is where Carrier info and date display at top
// iPhone X has a cut-out in top of dispaly where sensor package is located.
// For iPhone X increase height so cut-out does not hide text
const StatusBarHeightIos = DeviceInfo.getModel() === ModelIphoneX ? 30 : 20;
const StatusBarHeight = Platform.OS === 'ios' ? StatusBarHeightIos : 0;
Screenshot: iPhone X on left
