mirror of
https://github.com/streamich/react-use.git
synced 2025-12-08 18:02:14 +00:00
21 lines
279 B
Markdown
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>
|
|
);
|
|
};
|
|
```
|