react-native-screen-orientation-listener
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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';

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i react-native-screen-orientation-listener

    Weekly Downloads

    2

    Version

    1.0.4

    License

    ISC

    Unpacked Size

    155 kB

    Total Files

    8

    Last publish

    Collaborators

    • henninghall