0.9.1 • Published 5 years ago
react-gyroscope-sf v0.9.1
react-gyroscope-sf
DESCRIPTION
Simple Gyroscope component.
REQUIREMENTS
React v16.8.0 or higher - Created using useState and useEffect hooks.
USE EXAMPLE
- Import dependency
- Create your listener function and use in listener-prop.
import React from 'react';
import Gyro from 'react-gyroscope-sf';
const SomeCompoenent = () => {
const gyroListener = (r, t, s) => {
// Do something with values: rotation, tilt, spin
}
return (
<div>
<Gyro listener={gyroListener} />
</div>
)
}
export default SomeCompoenent;
Additional PROPS
- listener: (function) returns values x, y, z for the device's orientation