Skip to content

Commit 14d0e8f

Browse files
committed
Merge pull request #1928 from trotzig/master
Fix and add some documentation about query params
2 parents 55a06a0 + 0fe9ca2 commit 14d0e8f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

UPGRADE_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ and where you get it now if you're a route component (`this.props`)
258258
| `getPath()` | `location.pathname+location.query` |
259259
| `getPathname()` | `location.pathname` |
260260
| `getParams()` | `params` |
261-
| `getQuery()` | `query` |
261+
| `getQuery()` | `location.query` |
262262
| `getRoutes()` | `routes` |
263263
| `isActive(to, params, query)` | `history.isActive(pathname, query, onlyActiveOnIndex)` |
264264

docs/introduction/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ const Message = React.createClass({
221221
})
222222
```
223223

224+
You can also access parameters from the query string. If you for instance visit `/foo?bar=baz`, you can access `this.props.location.query.bar` to get the value `"baz"` from your Route component.
225+
224226
That's the gist of React Router. Application UIs are boxes inside of boxes inside of boxes; now you can keep those boxes in sync with the URL and link to them easily.
225227

226228
The docs about [route configuration](/docs/basics/RouteConfiguration.md) describe more of the router's features in depth.

0 commit comments

Comments
 (0)