react-use/docs/useLocation.md
2018-12-05 22:05:30 +01:00

368 B

useLocation

React sensor hook that tracks brower's location.

For Internet Explorer you need to install a polyfill.

Usage

import {useLocation} from 'react-use';

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

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