File tree 4 files changed +61
-1
lines changed
4 files changed +61
-1
lines changed Original file line number Diff line number Diff line change 1
1
# CHANGELOG
2
2
3
+ ## 0.26.0
4
+ - Support querystrings.
5
+ * Querystrings are not matched - they are stripped before matching patterns.
6
+ * Querystrings, if present, are parsed and passed as the ` _query ` prop.
7
+ * See the [ querystring docs] ( http://strml.viewdocs.io/react-router-component/querystring ) .
8
+
9
+ ## 0.25.4
10
+ - More ES6 fixes.
11
+
12
+ ## 0.25.3
13
+ - Hotfix: adjust API for url-pattern to fit ES6 modules.
14
+
15
+ ## 0.25.2
16
+ - Allow overriding url-pattern's compiler.
17
+
3
18
## 0.25.1
4
19
- Remove bad ReactComponent typecheck on Route/Location.
5
20
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ React router component can dispatch based on `location.pathname` or
56
56
57
57
Furthermore it provides advanced features like support for [ regex matching] [ regex ] ,
58
58
[ full page server side rendering] [ server-side ] , [ multiple routers] [ multiple ] on the same page,
59
- [ contextual routers] [ contextual ] and support for [ async components] [ async ] .
59
+ [ querystring parsing ] [ querystring ] , [ contextual routers] [ contextual ] and support for [ async components] [ async ] .
60
60
61
61
Its functionality is tested using [ Saucelabs] [ ] on all modern browsers (IE >= 9,
62
62
Chrome >= 27, Firefox >= 25, Safari >= 6 and Mobile Safari on iPhone and iPad >=
@@ -81,6 +81,7 @@ See [docs][] for the usage.
81
81
[ server-side ] : http://strml.viewdocs.io/react-router-component/server-side
82
82
[ multiple ] : http://strml.viewdocs.io/react-router-component/multiple
83
83
[ contextual ] : http://strml.viewdocs.io/react-router-component/contextual
84
+ [ querystring ] : http://strml.viewdocs.io/react-router-component/querystring
84
85
[ a-elements ] : http://strml.viewdocs.io/react-router-component/a-elements
85
86
[ rec-custom-link ] : http://strml.viewdocs.io/react-router-component/recipes/custom-link
86
87
[ rec-custom-router ] : http://strml.viewdocs.io/react-router-component/recipes/custom-router
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ React router component can dispatch based on `location.pathname` or
46
46
47
47
Furthermore it provides advanced features like support for [ full page server
48
48
side rendering] [ server-side ] , [ multiple routers] [ multiple ] on the same page,
49
+ [ querystring parsing] [ querystring ] ,
49
50
[ contextual routers] [ contextual ] , support for [ async components] [ async ] and
50
51
[ optional handling of normal ` <a> ` elements] [ a-elements ] .
51
52
@@ -214,6 +215,7 @@ These are the examples of what you can do with React Router component:
214
215
[ rec-es6-custom-router ] : recipes/rec-es6-custom-router
215
216
216
217
[ hash-routing ] : hash-routing
218
+ [ querystring ] : querystring
217
219
[ server-side ] : server-side
218
220
[ multiple ] : multiple
219
221
[ contextual ] : contextual
Original file line number Diff line number Diff line change
1
+ # Querystring parsing
2
+
3
+ React-router-component, as of 0.26.0, understands querystrings.
4
+
5
+ Querystrings are not matched as part of a route. It is not possible to switch routes
6
+ based on a querystring.
7
+
8
+ The route ` /foo/:bar ` will match both ` /foo/biff ` and ` /foo/baz?biff=baz&num=1 ` .
9
+
10
+ For example:
11
+
12
+ var App = React.createClass({
13
+
14
+ render: function() {
15
+ return (<Locations path={this.props.path)}
16
+ onBeforeNavigation={this.showProgressBar}
17
+ onNavigation={this.hideProgressBar}>
18
+ <Location path="/foo/:bar" handler={QueryPage} />
19
+ </Locations>
20
+ );
21
+ }
22
+ });
23
+
24
+ var QueryPage = React.createClass({
25
+ propTypes: {
26
+ bar: React.PropTypes.string,
27
+ _query: React.PropTypes.object
28
+ },
29
+
30
+ render: function() {
31
+ return (
32
+ <div>
33
+ Hello, this is main page of the application!
34
+ This component was passed the values:
35
+ Foo: <b>{this.props.foo}</b>
36
+ Query: <b>{JSON.stringify(this.props._query)}</b>
37
+ </div>
38
+ )
39
+ }
40
+ })
41
+
42
+ React.render(<App path="/foo/bar?baz=biff&num=1&react=isAwesome");
You can’t perform that action at this time.
0 commit comments