9
9
The path used in the URL.
10
10
11
11
It will concat with the parent route's path unless it starts with ` / ` .
12
- In which case you will need to use ` childWillMatch ` on the parent route
13
- so the router knows to keep going down the route tree.
12
+ In which case you will need to use ` absoluteChildPaths ` on the parent
13
+ route so the router knows to keep going down the route tree even though
14
+ the parent path doesn't match the url.
14
15
15
16
If left undefined, the router will try to match the child routes.
16
17
@@ -27,8 +28,8 @@ be rendered by the parent route component with `this.props.children`.
27
28
``` js
28
29
var routes = (
29
30
< Route component= {App}>
30
- < Route path= " groups" components = {Groups}/ >
31
- < Route path= " users" components = {Users}/ >
31
+ < Route path= " groups" component = {Groups}/ >
32
+ < Route path= " users" component = {Users}/ >
32
33
< / Route>
33
34
);
34
35
@@ -47,12 +48,18 @@ var App = React.createClass({
47
48
### ` components `
48
49
49
50
Routes can define multiple components as an object of name: component
50
- pairs to be rendered when the path matches the url. They can be rendred
51
+ pairs to be rendered when the path matches the url. They can be rendered
51
52
by the parent route component with ` this.props[name] ` .
52
53
53
54
#### Example
54
55
55
56
``` js
57
+ // think of it outside the context of the router, if you had pluggable
58
+ // portions of your `render`, you might do it like this
59
+ < App main= {< Users/ > } sidebar= {< UsersSidebar/ > }/ >
60
+ < App main= {< Groups/ > } sidebar= {< GroupsSidebar/ > }/ >
61
+
62
+ // So with the router its looks like this:
56
63
var routes = (
57
64
< Route component= {App}>
58
65
< Route path= " groups" components= {{main: Groups, sidebar: GroupsSidebar}}/ >
@@ -89,6 +96,7 @@ var Users = React.createClass({
89
96
);
90
97
}
91
98
});
99
+
92
100
```
93
101
94
102
### ` getComponents(state, cb) `
0 commit comments