Skip to content

Commit 3b7a144

Browse files
committed
Merge pull request remix-run#3191 from Gpx/patch-1
Update API docs for Link#to
2 parents 2880ead + b93d1e3 commit 3b7a144

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/API.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,23 @@ A `<Link>` can know when the route it links to is active and automatically apply
107107

108108
#### Props
109109
##### `to`
110-
The path to link to, e.g. `/users/123`.
111-
112-
##### `query`
110+
Can be either a string or an object.
111+
* If it's a string it represents the path to link to, e.g. `/users/123`.
112+
* If it's an object it can have four keys:
113+
* `pathname`: A string representing the path to link to.
114+
* `query`: An object of key:value pairs to be stringified.
115+
* `hash`: A hash to put in the URL, e.g. `#a-hash`.
116+
* `state`: State to persist to the `location`.
117+
118+
##### `query` **([Deprecated](https://github.com/reactjs/react-router/blob/master/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
113119
An object of key:value pairs to be stringified.
114120

115-
##### `hash`
121+
##### `hash` **([Deprecated](https://github.com/reactjs/react-router/blob/master/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
116122
A hash to put in the URL, e.g. `#a-hash`.
117123

118124
_Note: React Router currently does not manage scroll position, and will not scroll to the element corresponding to the hash. Scroll position management utilities are available in the [scroll-behavior](https://github.com/taion/scroll-behavior) library._
119125

120-
##### `state`
126+
##### `state` **([Deprecated](https://github.com/reactjs/react-router/blob/master/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
121127
State to persist to the `location`.
122128

123129
##### `activeClassName`

0 commit comments

Comments
 (0)