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 242242- yracnet
243243- yuleicul
244244- zheng-chuang
245+ - KubasuIvanSakwa
Original file line number Diff line number Diff line change @@ -10,9 +10,15 @@ title: useLocation
1010``` tsx
1111declare function useLocation(): Location ;
1212
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 ;
1622}
1723```
1824
@@ -38,4 +44,28 @@ function App() {
3844}
3945```
4046
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
4170[ location ] : ../utils/location
71+ [ navigate ] : ./use-navigate
You can’t perform that action at this time.
0 commit comments