react-device-orientation

0.1.0 • Public • Published

react-device-orientation

A react wrapper for device orientation events.

Installation

Using npm:

$ npm install --save react-device-orientation

Using yarn:

$ yarn add react-device-orientation

Example

import DeviceOrientation from 'react-device-orientation';
import React from 'react';
 
const App = () => (
  <DeviceOrientation>
    {({ absolute, alpha, beta, gamma }) => (
      <div>
        {`Absolute: ${absolute}`}
        {`Alpha: ${alpha}`}
        {`Beta: ${beta}`}
        {`Gamma: ${gamma}`}
      </div>
    )}
  </DeviceOrientation>
);

Contributing

Please feel free to submit any issues or pull requests.

License

MIT

Package Sidebar

Install

npm i react-device-orientation

Weekly Downloads

45

Version

0.1.0

License

MIT

Unpacked Size

7.27 kB

Total Files

4

Last publish

Collaborators

  • bsonntag