Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 261 Bytes

useBattery.md

File metadata and controls

19 lines (14 loc) · 261 Bytes

useBattery

React 传感器钩子,用于追踪电池状态。

用法

import {useBattery} from 'react-use';

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

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