Skip to content

Commit 82effef

Browse files
committed
08-lesson;
1 parent 0bd946d commit 82effef

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

lessons/08-index-routes/index.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +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((
10-
<Router history={hashHistory}>
11-
<Route path="/" component={App}>
12-
<Route path="/repos" component={Repos}>
13-
<Route path="/repos/:userName/:repoName" component={Repo}/>
14-
</Route>
15-
<Route path="/about" component={About}/>
16-
</Route>
17-
</Router>
11+
<Router history={hashHistory}>
12+
<Route path="/" component={App}>
13+
<IndexRoute component={Home}/>
14+
15+
<Route path="/repos" component={Repos}>
16+
<Route path="/repos/:userName/:repoName" component={Repo}/>
17+
</Route>
18+
<Route path="/about" component={About}/>
19+
</Route>
20+
</Router>
1821
), document.getElementById('app'))
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)