Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bsonntag/react-device-motion

A react wrapper for device motion events.
https://github.com/bsonntag/react-device-motion

component device-motion react

Last synced: about 1 month ago
JSON representation

A react wrapper for device motion events.

Awesome Lists containing this project

README

        

# react-device-motion

> A react wrapper for device motion events.

## Installation

Using npm:

```sh
$ npm install --save react-device-motion
```

Using yarn:

```sh
$ yarn add react-device-motion
```

## Example

```js
import DeviceMotion from 'react-device-motion';
import React from 'react';

const App = () => (

{({
acceleration,
accelerationIncludingGravity,
interval,
rotationRate
}) => (


{`Acceleration: ${JSON.stringify(acceleration)}`}
{`Acceleration including gravity: ${JSON.stringify(accelerationIncludingGravity)}`}
{`Interval: ${interval}`}
{`Rotation rate: ${JSON:stringify(rotationRate)}`}

)}

);
```

## Contributing

Please feel free to submit any issues or pull requests.

## License

MIT