A react wrapper for device orientation events.
Using npm:
$ npm install --save react-device-orientation
Using yarn:
$ yarn add react-device-orientation
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>
);
Please feel free to submit any issues or pull requests.
MIT