react-native-rotation-info
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

react-native-rotation-info

Get device rotation info

Installation

npm install react-native-rotation-info

Usage

import { getRotation, Surface } from "react-native-rotation-info";

// ...

const rotation = await getRotation();
if (rotation == Surface.ROTATION_0) {
  console.log(0);
} else if (rotation == Surface.ROTATION_90) {
  console.log(90);
} else if (rotation == Surface.ROTATION_180) {
  console.log(180);
} else if (rotation == Surface.ROTATION_270) {
  console.log(270);
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i react-native-rotation-info

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

255 kB

Total Files

96

Last publish

Collaborators

  • xulihang