File tree Expand file tree Collapse file tree 4 files changed +34
-1
lines changed
lessons/02-rendering-a-route Expand file tree Collapse file tree 4 files changed +34
-1
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
3
import App from './modules/App'
4
- render ( < App /> , document . getElementById ( 'app' ) )
4
+ import News from './modules/News'
5
+ import About from './modules/About'
6
+ import Repos from './modules/Repos'
7
+ import { Router , Route , hashHistory } from 'react-router'
8
+
9
+ render ( (
10
+ < Router history = { hashHistory } >
11
+ < Route path = "/" component = { App } />
12
+ < Route path = "/news" component = { News } />
13
+ < Route path = "/repos" component = { Repos } />
14
+ < Route path = "/about" component = { About } />
15
+ </ Router >
16
+ ) , document . getElementById ( 'app' ) ) ;
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ export default React . createClass ( {
4
+ render ( ) {
5
+ return < div > About</ div >
6
+ }
7
+ } )
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ export default React . createClass ( {
4
+ render ( ) {
5
+ return < div > Super News</ div >
6
+ }
7
+ } )
Original file line number Diff line number Diff line change
1
+ import React from 'react'
2
+
3
+ export default React . createClass ( {
4
+ render ( ) {
5
+ return < div > Repos</ div >
6
+ }
7
+ } )
You can’t perform that action at this time.
0 commit comments