Skip to content

Commit 0fe9ca2

Browse files
trotzig5nine
authored andcommitted
Add info about query params to Introduction
I found it hard to find information about how to access query parameter values in the docs. Adding a short paragraph about it to the "Introduction" guide could help others avoid having to dig deeper for it.
1 parent 41ae1b7 commit 0fe9ca2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)