You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-screen-orientation-listener

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-screen-orientation-listener

Detect screen orientation changes in React Native.

1.0.4
latest
npmnpm
Version published
Maintainers
1
Created
Source

React Native Screen Orientation Listener

Detects screen orientation changes in React Native without making changes in native code.

Installation

yarn add react-native-screen-orientation-listener

or

npm install react-native-screen-orientation-listener --save

Usage

import { ScreenOrientation } from 'react-native-screen-orientation-listener';

<ScreenOrientation onChange={onChange}>
    {/* Your app root */}
</ScreenOrientation>

const onChange = orientation => console.log("New screen orientation: " orientation)

Additional functions

import { isPortrait, isLandscape, getScreenOrientation } from 'react-native-screen-orientation-listener';

Keywords

react

FAQs

Package last updated on 27 Aug 2018

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