Socket
Socket
Sign inDemoInstall

react-native-device

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-device

Device detection for React Native


Version published
Weekly downloads
4
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

Device detection for react-native

Detect device type and screen size.

Installation

npm install react-native-device --save

API

  • isIpad

    • boolean
  • isIphone

    • boolean
  • kind

    • "iPad"
    • "iPhone4"
    • "iPhone5"
    • "iPhone6"
    • "iPhone6plus"
  • width

  • height

Usage example

'use strict';

var React = require('react-native');
var Device = require('react-native-device');
var {
  AppRegistry
} = React;

var ExampleApp = React.createClass({
  render: function() {
    if (Device.isIpad()) {
      // return iPad layout
    } else {
      // return iPhone layout
    }
  }
});

AppRegistry.registerComponent('ExampleApp', () => ExampleApp);

Keywords

FAQs

Package last updated on 14 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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