useGeolocation

Track device location via Geolocation API.

Usage Example
1import { useGeolocation } from '@danixsoft/hooks';
2
3function Example() {
4  const state = useGeolocation();
5  
6  if (state.loading) return <p>Loading...</p>;
7  if (state.error) return <p>Error: {state.error.message}</p>;
8  
9  return <p>{state.latitude}, {state.longitude}</p>;
10}