0.1.0 • Published 5 years ago

react-device-orientation v0.1.0

Weekly downloads
14
License
MIT
Repository
github
Last release
5 years ago

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