Skip to content

Commit 97437ad

Browse files
committed
Implementation for IndexRoute lesson-08
1 parent b8dc682 commit 97437ad

File tree

3 files changed

+4956
-1
lines changed

3 files changed

+4956
-1
lines changed

lessons/08-index-routes/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
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}/>
1214
<Route path="/repos" component={Repos}>
1315
<Route path="/repos/:userName/:repoName" component={Repo}/>
1416
</Route>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// modules/Home.js
2+
import React from 'react'
3+
4+
export default React.createClass({
5+
render() {
6+
return <div>Home</div>
7+
}
8+
})

0 commit comments

Comments
 (0)