Skip to content

Commit b3ee95a

Browse files
committed
Implementation of nested routes lesson-04
1 parent 430bfc9 commit b3ee95a

File tree

3 files changed

+4951
-3
lines changed

3 files changed

+4951
-3
lines changed

lessons/04-nested-routes/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import Repos from './modules/Repos'
77

88
render((
99
<Router history={hashHistory}>
10-
<Route path="/" component={App}/>
11-
<Route path="/repos" component={Repos}/>
12-
<Route path="/about" component={About}/>
10+
<Route path="/" component={App}>
11+
<Route path="/repos" component={Repos}/>
12+
<Route path="/about" component={About}/>
13+
</Route>
1314
</Router>
1415
), document.getElementById('app'))

lessons/04-nested-routes/modules/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export default React.createClass({
1010
<li><Link to="/about">About</Link></li>
1111
<li><Link to="/repos">Repos</Link></li>
1212
</ul>
13+
14+
{this.props.children}
1315
</div>
1416
)
1517
}

0 commit comments

Comments
 (0)