Skip to content

Commit 6117def

Browse files
taiontimdorr
authored andcommitted
Update docs (#3592)
- Move deprecated sections of API reference to bottom - Fix links to mjackson/history
1 parent 92824f6 commit 6117def

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

docs/API.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,6 @@ function createElement(Component, props) {
7777
}
7878
```
7979

80-
##### `stringifyQuery(queryObject)` (deprecated)
81-
A function used to convert an object from [`<Link>`](#link)s or calls to
82-
[`transitionTo`](#transitiontopathname-query-state) to a URL query string.
83-
84-
##### `parseQueryString(queryString)` (deprecated)
85-
A function used to convert a query string into an object that gets passed to route component props.
86-
8780
##### `onError(error)`
8881
While the router is matching, errors may bubble up, here is your opportunity to catch and deal with them. Typically these will come from async features like [`route.getComponents`](#getcomponentsnextstate-callback), [`route.getIndexRoute`](#getindexroutepartialnextstate-callback), and [`route.getChildRoutes`](#getchildroutespartialnextstate-callback).
8982

@@ -95,6 +88,10 @@ This is primarily for integrating with other libraries that need to participate
9588

9689
Ensure that you render a `<RouterContext>` at the end of the line, passing all the props passed to `render`.
9790

91+
##### `stringifyQuery(queryObject)` (deprecated)
92+
93+
##### `parseQueryString(queryString)` (deprecated)
94+
9895

9996
#### Examples
10097
Please see the [`examples/`](/examples) directory of the repository for extensive examples of using `<Router>`.
@@ -108,7 +105,7 @@ A `<Link>` can know when the route it links to is active and automatically apply
108105

109106
#### Props
110107
##### `to`
111-
A [location descriptor](https://github.com/mjackson/history/blob/master/docs/Glossary.md#locationdescriptor). Usually this is a string or an object, with the following semantics:
108+
A [location descriptor](https://github.com/ReactJSTraining/history/blob/master/docs/Glossary.md#locationdescriptor). Usually this is a string or an object, with the following semantics:
112109

113110
* If it's a string it represents the absolute path to link to, e.g. `/users/123` (relative paths are not supported).
114111
* If it's an object it can have four keys:
@@ -117,16 +114,7 @@ A [location descriptor](https://github.com/mjackson/history/blob/master/docs/Glo
117114
* `hash`: A hash to put in the URL, e.g. `#a-hash`.
118115
* `state`: State to persist to the `location`.
119116

120-
##### `query` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
121-
An object of key:value pairs to be stringified.
122-
123-
##### `hash` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
124-
A hash to put in the URL, e.g. `#a-hash`.
125-
126-
_Note: React Router currently does not manage scroll position, and will not scroll to the element corresponding to the hash._
127-
128-
##### `state` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
129-
State to persist to the `location`.
117+
_Note: React Router currently does not manage scroll position, and will not scroll to the element corresponding to `hash`._
130118

131119
##### `activeClassName`
132120
The className a `<Link>` receives when its route is active. No active class by default.
@@ -143,6 +131,12 @@ If `true`, the `<Link>` will only be active when the current route exactly match
143131
##### *others*
144132
You can also pass props you'd like to be on the `<a>` such as a `title`, `id`, `className`, etc.
145133

134+
##### `query` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
135+
136+
##### `hash` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
137+
138+
##### `state` **([deprecated](/upgrade-guides/v2.0.0.md#link-to-onenter-and-isactive-use-location-descriptors) see `to`)**
139+
146140
#### Example
147141
Given a route like `<Route path="/users/:userId" />`:
148142

@@ -613,9 +607,9 @@ For more details, please see the [histories guide](/docs/guides/Histories.md).
613607
`useRouterHistory` is a `history` enhancer that configures a given `createHistory` factory to work with React Router. This allows using custom histories in addition to the bundled singleton histories.
614608

615609
It also pre-enhances the history with the
616-
[useQueries](https://github.com/mjackson/history/blob/master/docs/QuerySupport.md)
610+
[useQueries](https://github.com/ReactJSTraining/history/blob/master/docs/QuerySupport.md)
617611
and
618-
[useBasename](https://github.com/mjackson/history/blob/master/docs/BasenameSupport.md)
612+
[useBasename](https://github.com/ReactJSTraining/history/blob/master/docs/BasenameSupport.md)
619613
enhancers from `history`
620614

621615
#### Example

docs/guides/Histories.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ render(
139139

140140
If you'd like to further customize the history options or use other
141141
enhancers from
142-
[history](https://github.com/mjackson/history/) you can use
142+
[history](https://github.com/ReactJSTraining/history/) you can use
143143
`useRouterHistory`.
144144

145145
Be aware that `useRouterHistory` already pre-enhances your history
146-
factory with the [useQueries](https://github.com/mjackson/history/blob/master/docs/QuerySupport.md) and [useBasename](https://github.com/mjackson/history/blob/master/docs/BasenameSupport.md) enhancers from `history`.
146+
factory with the [useQueries](https://github.com/ReactJSTraining/history/blob/master/docs/QuerySupport.md) and [useBasename](https://github.com/ReactJSTraining/history/blob/master/docs/BasenameSupport.md) enhancers from `history`.
147147

148148
### Examples:
149149

0 commit comments

Comments
 (0)