Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-device-info

Package Overview
Dependencies
Maintainers
5
Versions
256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-device-info - npm Package Compare versions

Comparing version 0.23.0 to 0.24.0

3

CHANGELOG.md
## Release Notes
### next
### 0.24.0
* Added `isLandscape()` (https://github.com/rebeccahughes/react-native-device-info/pull/504)

@@ -5,0 +6,0 @@ ### 0.23.0

@@ -42,5 +42,6 @@ // should be imported this way:

getFreeDiskStorage: () => number;
getBatteryLevel: () => Promise<number>
getBatteryLevel: () => Promise<number>;
isLandscape: () => boolean;
};
export default _default;
/**
* @providesModule react-native-device-info
*/
import { Platform, NativeModules } from 'react-native';
import { Platform, NativeModules, Dimensions } from 'react-native';

@@ -242,2 +242,6 @@ var RNDeviceInfo = NativeModules.RNDeviceInfo;

},
isLandscape: function() {
const { height, width } = Dimensions.get('window');
return width >= height;
}
};
{
"name": "react-native-device-info",
"version": "0.23.0",
"version": "0.24.0",
"description": "Get device information using react-native",

@@ -5,0 +5,0 @@ "main": "deviceinfo.js",

@@ -236,3 +236,4 @@ # react-native-device-info

| [isTablet()](#istablet) | `boolean` | ✅ | ✅ | ✅ | ? |
| [hasNotch()](#hasNotch) | `boolean` | ✅ | ✅ | ✅ | ? |
| [hasNotch()](#hasNotch) | `boolean` | ✅ | ✅ | ✅ | 0.23.0 |
| [isLandscape()](#isLandscape) | `boolean` | ✅ | ✅ | ✅ | 0.24.0 |

@@ -840,2 +841,12 @@ ---

### isLandscape()
Tells if the device is currently in landscape mode.
**Examples**
```js
const isLandscape = DeviceInfo.isLandscape(); // true
```
### hasNotch()

@@ -842,0 +853,0 @@

@@ -41,3 +41,4 @@ /**

freeDiskStorage: 0,
getBatteryLevel: () => Promise.resolve(0)
getBatteryLevel: () => Promise.resolve(0),
isLandscape: false
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc