react-device-orientation
v0.1.0
Published
A react wrapper for device orientation events.
Downloads
51
Readme
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