mirror of
https://github.com/streamich/react-use.git
synced 2025-12-08 18:02:14 +00:00
442 B
442 B
useGeolocation
React sensor hook that tracks user's geographic location. This hook accepts position options.
Usage
import {useGeolocation} from 'react-use';
const Demo = () => {
const state = useGeolocation();
return (
<pre>
{JSON.stringify(state, null, 2)}
</pre>
);
};
Reference
useGeolocation(options: PositionOptions)