Skip to content

Commit 494a195

Browse files
committed
Resolve lesson 08
1 parent 91bc89d commit 494a195

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

lessons/08-index-routes/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import React from 'react'
22
import { render } from 'react-dom'
3-
import { Router, Route, hashHistory } from 'react-router'
3+
import { Router, Route, hashHistory, IndexRoute } from 'react-router'
44
import App from './modules/App'
55
import About from './modules/About'
66
import Repos from './modules/Repos'
77
import Repo from './modules/Repo'
8+
import Home from './modules/Home'
89

910
render((
1011
<Router history={hashHistory}>
1112
<Route path="/" component={App}>
13+
<IndexRoute component={Home}/>
14+
1215
<Route path="/repos" component={Repos}>
1316
<Route path="/repos/:userName/:repoName" component={Repo}/>
1417
</Route>
18+
1519
<Route path="/about" component={About}/>
1620
</Route>
1721
</Router>

lessons/08-index-routes/modules/App.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react'
22
import NavLink from './NavLink'
3+
import Home from './Home'
34

45
export default React.createClass({
56
render() {
@@ -10,6 +11,7 @@ export default React.createClass({
1011
<li><NavLink to="/about">About</NavLink></li>
1112
<li><NavLink to="/repos">Repos</NavLink></li>
1213
</ul>
14+
1315
{this.props.children}
1416
</div>
1517
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react'
2+
3+
export default React.createClass({
4+
render() {
5+
return <div>Home</div>
6+
}
7+
})

0 commit comments

Comments
 (0)