react-use/docs/useGeolocation.md
2018-10-27 03:31:05 +02:00

21 lines
279 B
Markdown

# `useGeolocation`
React sensor hook that tracks user's geographic location.
## Usage
```jsx
import {useGeolocation} from 'react-use';
const Demo = () => {
const state = useGeolocation();
return (
<pre>
{JSON.stringify(state, null, 2)}
</pre>
);
};
```