File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 242
242
- yracnet
243
243
- yuleicul
244
244
- zheng-chuang
245
+ - KubasuIvanSakwa
Original file line number Diff line number Diff line change @@ -10,9 +10,15 @@ title: useLocation
10
10
``` tsx
11
11
declare function useLocation(): Location ;
12
12
13
- interface Location extends Path {
14
- state: any ;
15
- key: Key ;
13
+ interface Location <State = any > extends Path {
14
+ state: State ;
15
+ key: string ;
16
+ }
17
+
18
+ interface Path {
19
+ pathname: string ;
20
+ search: string ;
21
+ hash: string ;
16
22
}
17
23
```
18
24
@@ -38,4 +44,28 @@ function App() {
38
44
}
39
45
```
40
46
47
+ ## Properties
48
+
49
+ ### ` location.hash `
50
+
51
+ The hash of the current URL.
52
+
53
+ ### ` location.key `
54
+
55
+ The unique key of this location.
56
+
57
+ ### ` location.pathname `
58
+
59
+ The path of the current URL.
60
+
61
+ ### ` location.search `
62
+
63
+ The query string of the current URL.
64
+
65
+ ### ` location.state `
66
+
67
+ The state value of the location created by [ ` <Link state> ` ] [ link-state ] or [ ` navigate ` ] [ navigate ] .
68
+
69
+ [ link-state ] : ../components/link#state
41
70
[ location ] : ../utils/location
71
+ [ navigate ] : ./use-navigate
You can’t perform that action at this time.
0 commit comments