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

Commit 626842f

Browse files
author
Hudson Prestidge
committed
complete lesson 6
1 parent 4ad3232 commit 626842f

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

lessons/06-params/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import { Router, Route, hashHistory } from 'react-router'
44
import App from './modules/App'
55
import About from './modules/About'
66
import Repos from './modules/Repos'
7+
import Repo from './modules/Repo'
78

89
render((
910
<Router history={hashHistory}>
1011
<Route path="/" component={App}>
1112
<Route path="/repos" component={Repos}/>
13+
<Route path="/repos/:userName/:repoName" component={Repo}/>
1214
<Route path="/about" component={About}/>
1315
</Route>
1416
</Router>

lessons/06-params/modules/About.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import React from 'react'
22

33
export default React.createClass({
44
render() {
5-
return <div>About</div>
5+
return (<div>About</div>)
66
}
77
})

lessons/06-params/modules/Repo.js

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

lessons/06-params/modules/Repos.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
import React from 'react'
2+
import { Link } from 'react-router'
3+
24

35
export default React.createClass({
46
render() {
5-
return <div>Repos</div>
7+
return (
8+
<div>
9+
<h2>Repos</h2>
10+
11+
<ul>
12+
<li><Link to="/repos/reactjs/React-Router">React Router</Link></li>
13+
<li><Link to="/repos/facebook/React">React</Link></li>
14+
</ul>
15+
16+
</div>
17+
)
618
}
719
})

0 commit comments

Comments
 (0)