A react wrapper for device motion events.
Using npm:
$ npm install --save react-device-motion
Using yarn:
$ yarn add react-device-motion
import DeviceMotion from 'react-device-motion';
import React from 'react';
const App = () => (
<DeviceMotion>
{({
acceleration,
accelerationIncludingGravity,
interval,
rotationRate
}) => (
<div>
{`Acceleration: ${JSON.stringify(acceleration)}`}
{`Acceleration including gravity: ${JSON.stringify(accelerationIncludingGravity)}`}
{`Interval: ${interval}`}
{`Rotation rate: ${JSON:stringify(rotationRate)}`}
</div>
)}
</DeviceMotion>
);
Please feel free to submit any issues or pull requests.
MIT