Skip to content

Commit

Permalink
Fix router example app (#61)
Browse files Browse the repository at this point in the history
* (fix) move route declaration within scope

* (fix) update eslint-disable line
  • Loading branch information
potench authored Nov 9, 2017
1 parent 84264e7 commit 7687ee9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/apps/routing/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ class App extends Component {
}

class AppContainer extends Component {
// eslint-disable-next-line react/sort-comp
routes = {
"/Travel/Europe": {component: Home},
"/Travel/Europe/France": {component: Page, params: {id: "France"}},
"/Travel/Europe/Spain": {component: Page, params: {id: "Spain"}}
};

state = {
routeComponent: this.routes["/Travel/Europe"].component
};
Expand All @@ -81,13 +88,6 @@ class AppContainer extends Component {

history = createHistory();

routes = {
// eslint-disable-line react/sort-comp
"/Travel/Europe": {component: Home},
"/Travel/Europe/France": {component: Page, params: {id: "France"}},
"/Travel/Europe/Spain": {component: Page, params: {id: "Spain"}}
};

render() {
return (
<App
Expand Down

0 comments on commit 7687ee9

Please sign in to comment.