@m31271n/react-norotation

0.2.1 • Public • Published

react-norotation

code style: prettier Dependency Status DevDependency Status Travis Build Status NPM Downloads

Do not rotate your device, ok?

Install

$ npm install @m31271n/react-norotation

Usage

import React from 'react';
import NoRotation from '@m31271n/react-norotation';

class App extends React.Component {
  onPortrait = () => {};

  onLandscape = () => {};

  render() {
    return (
      <NoRotation
        desiredOrientation="portrait"
        adjustMethod="auto"
        onPortrait={this.onPortrait}
        onLandscape={this.onLandscape}
      >
        // children
      </NoRotation>
    );
  }
}

Available Props

props type description
desiredOrientation String Orientation you desired. Available value: "portrait" / "landscape".
adjustMethod String Ajust method to use when current orientation is not equal to desiredORientation. Available value: "manual" / "auto".
onPortrait Function Callback executed when current orienttation switchs to portrait.
onLandscape Function Callback executed when current orienttation switchs to landscape.

TODO

  • fix broken test

Readme

Keywords

none

Package Sidebar

Install

npm i @m31271n/react-norotation

Weekly Downloads

4

Version

0.2.1

License

MIT

Unpacked Size

13.2 kB

Total Files

4

Last publish

Collaborators

  • m31271n_