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
A function used to convert a query string into an object that gets passed to route component props.
86
-
87
80
##### `onError(error)`
88
81
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).
89
82
@@ -95,6 +88,10 @@ This is primarily for integrating with other libraries that need to participate
95
88
96
89
Ensure that you render a `<RouterContext>` at the end of the line, passing all the props passed to `render`.
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
108
105
109
106
#### Props
110
107
##### `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:
112
109
113
110
* If it's a string it represents the absolute path to link to, e.g. `/users/123` (relative paths are not supported).
114
111
* 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
117
114
*`hash`: A hash to put in the URL, e.g. `#a-hash`.
118
115
*`state`: State to persist to the `location`.
119
116
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`._
130
118
131
119
##### `activeClassName`
132
120
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
143
131
##### *others*
144
132
You can also pass props you'd like to be on the `<a>` such as a `title`, `id`, `className`, etc.
145
133
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
+
146
140
#### Example
147
141
Given a route like `<Route path="/users/:userId" />`:
148
142
@@ -613,9 +607,9 @@ For more details, please see the [histories guide](/docs/guides/Histories.md).
613
607
`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.
Copy file name to clipboardExpand all lines: docs/guides/Histories.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -139,11 +139,11 @@ render(
139
139
140
140
If you'd like to further customize the history options or use other
141
141
enhancers from
142
-
[history](https://github.com/mjackson/history/) you can use
142
+
[history](https://github.com/ReactJSTraining/history/) you can use
143
143
`useRouterHistory`.
144
144
145
145
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`.
0 commit comments