Skip to content

Commit

Permalink
docs: 📝
Browse files Browse the repository at this point in the history
  • Loading branch information
somoore committed Nov 17, 2022
1 parent b42bdfb commit e05f524
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,23 @@ Potentially "Useful React hooks"!

## Usage

coming soon...
### useGeolocation

```javascript
export const App = () => {
const error = (err: GeolocationPositionError) => {
console.error(err);
};

const [location, setlocation] = useState<GeoPosition>();

useGeolocation({ success: setlocation, error });

return (
<>
<p>Longitude: {location?.coords.longitude}</p>
<p>Latitude: {location?.coords.latitude}</p>
</>
);
};
```

0 comments on commit e05f524

Please sign in to comment.