File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
lessons/02-rendering-a-route Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 11import React from 'react'
22import { render } from 'react-dom'
33import App from './modules/App'
4- render ( < App /> , document . getElementById ( 'app' ) )
4+ import About from './modules/About'
5+ import Repos from './modules/Repos'
6+ import { Router , Route , hashHistory } from 'react-router'
7+
8+ render ( (
9+ < Router history = { hashHistory } >
10+ < Route path = "/" component = { App } />
11+ < Route path = "/about" component = { About } />
12+ < Route path = "/repos" component = { Repos } />
13+ </ Router >
14+ ) , 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 me </ 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