Skip to content

Commit 495d11d

Browse files
authored
Merge pull request #174 from uidotdev/copy-updates
Update description
2 parents d91d8d4 + 3cd6278 commit 495d11d

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

usehooks.com/src/content/hooks/useGeolocation.mdx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: useGeolocation
33
rank: 36
4-
tagline: Add undo / redo functionality with useHistoryState.
4+
tagline: Access and monitor a user's geolocation (after they give permission) with useGeolocation.
55
sandboxId: usegeolocation-3f1d0f
66
previewHeight: 900px
77
relatedHooks:
@@ -14,24 +14,30 @@ import HookDescription from "../../components/HookDescription.astro";
1414
import StaticCodeContainer from "../../components/StaticCodeContainer.astro";
1515

1616
<HookDescription name={frontmatter.name}>
17-
The useHistoryState hook is useful for managing state with undo and redo
18-
capabilities in React components. The hook offers functions like undo, redo,
19-
set, and clear to interact with the state as well as other state related
20-
values like canUndo and canRedo.
17+
The useGeolocation hook is useful for accessing and monitoring the user's
18+
geolocation (after they give permission) in a React application. By utilizing
19+
the hook, developers can easily retrieve the user's current position,
20+
including latitude, longitude, altitude, accuracy, heading, speed, and
21+
timestamp.
2122
</HookDescription>
2223

2324
<div class="reference">
2425
### Parameters
2526

26-
<div class="table-container">
27-
| Name | Type | Description |
28-
| ------- | ------ | ----------- |
29-
| options | object | This is an optional configuration object provided when calling `useGeolocation`. It is used when calling `navigator.geolocation.getCurrentPosition()` and `navigator.geolocation.watchPosition()`. Some of the attributes it accepts are `enableHighAccuracy`, `timeout`, and `maximumAge`. |
30-
</div>
27+
{" "}
3128

32-
### Return Values
29+
<div class="table-container">
30+
| Name | Type | Description | | ------- | ------ | ----------- | | options |
31+
object | This is an optional configuration object provided when calling
32+
`useGeolocation`. It is used when calling
33+
`navigator.geolocation.getCurrentPosition()` and
34+
`navigator.geolocation.watchPosition()`. Some of the attributes it accepts are
35+
`enableHighAccuracy`, `timeout`, and `maximumAge`. |
36+
</div>
3337

34-
The hook returns an object containing the following properties:
38+
### Return Values
39+
40+
The hook returns an object containing the following properties:
3541

3642
<div class="table-container">
3743
| Name | Type | Description |
@@ -83,7 +89,6 @@ function Location() {
8389

8490
return <Demo state={state} />;
8591
}
86-
8792
```
8893

8994
</StaticCodeContainer>

0 commit comments

Comments
 (0)