Skip to content

Commit 9fc24d3

Browse files
committed
Lesson 02 Final
1 parent 50f7f54 commit 9fc24d3

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
import React from 'react'
22
import { render } from 'react-dom'
3+
import { Router, Route, hashHistory } from 'react-router'
34
import App from './modules/App'
4-
render(<App/>, document.getElementById('app'))
5+
import About from './modules/About'
6+
import Repos from './modules/Repos'
7+
8+
render((
9+
<Router history={hashHistory}>
10+
<Route path="/" component={App}/>
11+
<Route path="/repos" component={Repos}/>
12+
<Route path="/about" component={About}/>
13+
</Router>
14+
), document.getElementById('app'))
15+

modules/About.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
3+
export default React.createClass({
4+
render() {
5+
return <div>About</div>
6+
}
7+
})
8+

modules/Repos.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react'
2+
3+
export default React.createClass({
4+
render() {
5+
return <div>Repos</div>
6+
}
7+
})
8+

0 commit comments

Comments
 (0)