Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 255 Bytes

useBattery.md

File metadata and controls

20 lines (14 loc) · 255 Bytes

useBattery

React sensor hook that tracks battery status.

Usage

import {useBattery} from 'react-use';

const Demo = () => {
  const state = useBattery();

  return (
    <pre>
      {JSON.stringify(state, null, 2)}
    </pre>
  );
};