File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,18 @@ var App = React.createClass({
27
27
render () {
28
28
var Child;
29
29
switch (this .props .route ) {
30
- case ' about' : Child = About; break ;
31
- case ' inbox' : Child = Inbox; break ;
30
+ case ' / about' : Child = About; break ;
31
+ case ' / inbox' : Child = Inbox; break ;
32
32
default : Child = Home;
33
33
}
34
34
35
35
return (
36
36
< div>
37
37
< h1> App< / h1>
38
+ < ul>
39
+ < li>< a href= " #/about" > About< / a>< / li>
40
+ < li>< a href= " #/inbox" > Inbox< / a>< / li>
41
+ < / ul>
38
42
< Child/ >
39
43
< / div>
40
44
)
@@ -111,12 +115,19 @@ import HashHistory from 'react-router/lib/HashHistory';
111
115
112
116
// ...
113
117
114
- // then we delete a bunch of code from `App`
118
+ // then we delete a bunch of code from `App` and add some `Link`
119
+ // components
115
120
var App = React .createClass ({
116
121
render () {
117
122
return (
118
123
< div>
119
124
< h1> App< / h1>
125
+ {/* change the <a>s to <Links>s */ }
126
+ < ul>
127
+ < li>< Link to= " /about" > About< / Link>< / li>
128
+ < li>< Link to= " /inbox" > Inbox< / Link>< / li>
129
+ < / ul>
130
+
120
131
{/*
121
132
next we replace `<Child>` with `this.props.children`
122
133
the router will figure out the children for us
You can’t perform that action at this time.
0 commit comments