Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/bsonntag/react-device-motion
- Owner: bsonntag
- License: mit
- Created: 2018-06-25T22:38:05.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-10-16T16:45:10.000Z (about 1 year ago)
- Last Synced: 2024-09-30T08:22:40.943Z (about 2 months ago)
- Topics: component, device-motion, react
- Language: JavaScript
- Size: 1.2 MB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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