Skip to content

Commit 250b9e6

Browse files
committed
Merge pull request #1281 from tinybug/master
split code in chunks
2 parents 970d087 + aec8ca4 commit 250b9e6

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

examples/real-world/containers/Root.dev.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import React, { Component, PropTypes } from 'react'
22
import { Provider } from 'react-redux'
3-
import Routes from '../routes'
3+
import routes from '../routes'
44
import DevTools from './DevTools'
5+
import { Router, browserHistory } from 'react-router'
56

67
export default class Root extends Component {
78
render() {
89
const { store } = this.props
910
return (
1011
<Provider store={store}>
1112
<div>
12-
<Routes />
13+
<Router history={browserHistory} routes={routes} />
1314
<DevTools />
1415
</div>
1516
</Provider>

examples/real-world/containers/Root.prod.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React, { Component, PropTypes } from 'react'
22
import { Provider } from 'react-redux'
3-
4-
import Routes from '../routes'
3+
import routes from '../routes'
4+
import { Router, browserHistory } from 'react-router'
55

66
export default class Root extends Component {
77
render() {
88
const { store } = this.props
99
return (
1010
<Provider store={store}>
11-
<Routes />
11+
<Router history={browserHistory} routes={routes} />
1212
</Provider>
1313
)
1414
}

examples/real-world/routes.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import React from 'react'
2-
import { Route, browserHistory, Router } from 'react-router'
2+
import { Route } from 'react-router'
33
import App from './containers/App'
44
import UserPage from './containers/UserPage'
55
import RepoPage from './containers/RepoPage'
66

7-
export default function Routes() {
8-
return (
9-
<Router history={browserHistory}>
10-
<Route path="/" component={App}>
11-
<Route path="/:login/:name"
12-
component={RepoPage} />
13-
<Route path="/:login"
14-
component={UserPage} />
15-
</Route>
16-
</Router>
17-
)
18-
}
7+
export default (
8+
<Route path="/" component={App}>
9+
<Route path="/:login/:name"
10+
component={RepoPage} />
11+
<Route path="/:login"
12+
component={UserPage} />
13+
</Route>
14+
)

0 commit comments

Comments
 (0)