Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 279 Bytes

useGeolocation.md

File metadata and controls

20 lines (14 loc) · 279 Bytes

useGeolocation

React sensor hook that tracks user's geographic location.

Usage

import {useGeolocation} from 'react-use';

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

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