Skip to content

Commit 7687ee9

Browse files
authored
Fix router example app (#61)
* (fix) move route declaration within scope * (fix) update eslint-disable line
1 parent 84264e7 commit 7687ee9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/apps/routing/app.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ class App extends Component {
6161
}
6262

6363
class AppContainer extends Component {
64+
// eslint-disable-next-line react/sort-comp
65+
routes = {
66+
"/Travel/Europe": {component: Home},
67+
"/Travel/Europe/France": {component: Page, params: {id: "France"}},
68+
"/Travel/Europe/Spain": {component: Page, params: {id: "Spain"}}
69+
};
70+
6471
state = {
6572
routeComponent: this.routes["/Travel/Europe"].component
6673
};
@@ -81,13 +88,6 @@ class AppContainer extends Component {
8188

8289
history = createHistory();
8390

84-
routes = {
85-
// eslint-disable-line react/sort-comp
86-
"/Travel/Europe": {component: Home},
87-
"/Travel/Europe/France": {component: Page, params: {id: "France"}},
88-
"/Travel/Europe/Spain": {component: Page, params: {id: "Spain"}}
89-
};
90-
9191
render() {
9292
return (
9393
<App

0 commit comments

Comments
 (0)