Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 2af9aa3

Browse files
author
TsaiKoga
committed
Finish lesson 2
1 parent 2673e24 commit 2af9aa3

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
import React from 'react'
22
import { render } from 'react-dom'
3+
import {Router, Route, hasHistory} 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={hasHistory}>
10+
<Route path="/" component={App} />
11+
<Route path="/about" component={About} />
12+
<Route path="/repos" component={Repos} />
13+
</Router>
14+
), document.getElementById('app'))
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// modules/About.js
2+
import React from 'react'
3+
4+
export default React.createClass({
5+
render() {
6+
return <div>About</div>
7+
}
8+
})
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>Repos</div>
6+
}
7+
})

0 commit comments

Comments
 (0)