useDeviceOrientation
subscribes to deviceOrientationEvent
Note: This is using the new React Hooks API Proposal
Install
npm install usedeviceorientation --save
- Yarn
yarn add usedeviceorientation
Usage
; { let orientation = ;// { // absolute: DeviceOrientationEvent.absolute,// alpha: DeviceOrientationEvent.alpha,// beta: DeviceOrientationEvent.beta,// gamma: DeviceOrientationEvent.gamma// } // ...}