Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 280 Bytes

useGeolocation.md

File metadata and controls

20 lines (14 loc) · 280 Bytes

useGeolocation

React 传感器钩子,用于追踪用户地理位置。

用法

import {useGeolocation} from 'react-use';

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

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