react-code-dataset / react-use /docs /useLocation.md
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
|
Raw History Blame Contribute Delete
368 Bytes
# `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>
);
};
```