Skip to content

Files

Latest commit

30cee86 Β· Dec 5, 2018

History

History
22 lines (15 loc) Β· 368 Bytes

useLocation.md

File metadata and controls

22 lines (15 loc) Β· 368 Bytes

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>
  );
};