web-api-hooks
Version:
Essential set of React Hooks for convenient Web API consumption.
14 lines (13 loc) • 368 B
TypeScript
import { EventArgs } from './types';
/**
* Tracks acceleration and rotation rate of the device.
*
* @returns Own properties of the last corresponding event.
*
* @example
* function Component() {
* const { acceleration, rotationRate, interval } = useDeviceMotion();
* // ...
* }
*/
export default function useDeviceMotion(): EventArgs<DeviceMotionEvent>;