You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/link.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,8 @@ interface LinkProps
21
21
state?:any;
22
22
to:To;
23
23
reloadDocument?:boolean;
24
+
preventScrollReset?:boolean;
25
+
relative?:"route"|"path";
24
26
}
25
27
26
28
typeTo=string|Partial<Path>;
@@ -116,5 +118,26 @@ An example when you might want this behavior is a list of tabs that manipulate t
116
118
117
119
```
118
120
121
+
## `replace`
122
+
123
+
The `replace` property can be used if you'd like to replace the current entry in the history stack via [`history.replaceState`][history-replace-state] instead of the default usage of [`history.pushState`][history-push-state].
124
+
125
+
## `state`
126
+
127
+
The `state` property can be used to set a stateful value for the new location which is stored inside [history state][history-state]. This value can subsequently be accessed via `useLocation()`.
128
+
129
+
```tsx
130
+
<Linkto="new-path"state={{ some: "value" }} />
131
+
```
132
+
133
+
You can access this state value while on the "new-path" route:
0 commit comments