File tree Expand file tree Collapse file tree 4 files changed +46
-2
lines changed Expand file tree Collapse file tree 4 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
import { render } from 'react-dom'
3
+ import { Router , Route , hashHistory } from 'react-router'
4
+ import About from './modules/About'
5
+ import Repos from './modules/Repos'
3
6
import App from './modules/App'
4
- render ( < App /> , document . getElementById ( 'app' ) )
7
+
8
+
9
+ render (
10
+ (
11
+ < Router history = { hashHistory } >
12
+ < Route path = "/" component = { App } />
13
+ < Route path = "about" component = { About } />
14
+ < Route path = "repos" component = { Repos } />
15
+ </ Router >
16
+ ) , document . getElementById ( 'app' )
17
+ )
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ export default React . createClass ( {
4
+
5
+ render ( ) {
6
+ return
7
+ < div >
8
+ About
9
+ </ div >
10
+ }
11
+ } )
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
+ import { Link } from 'react-router'
2
3
3
4
export default React . createClass ( {
4
5
render ( ) {
5
- return < div > Hello, React Router!</ div >
6
+ return (
7
+ < div >
8
+ < h1 > React Router Tutorial</ h1 >
9
+ < ul role = "nav" >
10
+ < li > < Link to = "/about" > About</ Link > </ li >
11
+ < li > < Link to = "/repos" > Repos</ Link > </ li >
12
+ </ ul >
13
+ </ div >
14
+ )
6
15
}
7
16
} )
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ export default React . createClass ( {
4
+
5
+ render ( ) {
6
+ return
7
+ < div >
8
+ Repos
9
+ </ div >
10
+ }
11
+ } )
You can’t perform that action at this time.
0 commit comments