mirror of
https://github.com/streamich/react-use.git
synced 2025-12-08 18:02:14 +00:00
23 lines
368 B
Markdown
23 lines
368 B
Markdown
# `useLocation`
|
|
|
|
React sensor hook that tracks brower's location.
|
|
|
|
For Internet Explorer you need to [install a polyfill](https://github.com/streamich/react-use/issues/73).
|
|
|
|
|
|
## Usage
|
|
|
|
```jsx
|
|
import {useLocation} from 'react-use';
|
|
|
|
const Demo = () => {
|
|
const state = useLocation();
|
|
|
|
return (
|
|
<pre>
|
|
{JSON.stringify(state, null, 2)}
|
|
</pre>
|
|
);
|
|
};
|
|
```
|