diff --git a/Libraries/Utilities/NativeDeviceInfo.js b/Libraries/Utilities/NativeDeviceInfo.js index b29b68e0cdd..e1f2a6625de 100644 --- a/Libraries/Utilities/NativeDeviceInfo.js +++ b/Libraries/Utilities/NativeDeviceInfo.js @@ -43,7 +43,18 @@ export interface Spec extends TurboModule { } const NativeModule: Spec = TurboModuleRegistry.getEnforcing('DeviceInfo'); +let constants = null; -const NativeDeviceInfo = NativeModule; +const NativeDeviceInfo = { + getConstants(): {| + +Dimensions: DimensionsPayload, + +isIPhoneX_deprecated?: boolean, + |} { + if (constants == null) { + constants = NativeModule.getConstants(); + } + return constants; + }, +}; export default NativeDeviceInfo;