|
1 | 1 | // @flow |
2 | | -import React, {type Node, type StatelessFunctionalComponent,} from 'react'; |
3 | | -import {hot} from 'react-hot-loader'; |
| 2 | +import React, { |
| 3 | + type Node, type StatelessFunctionalComponent, |
| 4 | +} from 'react'; |
| 5 | + |
| 6 | +import { |
| 7 | + hot, |
| 8 | +} from 'react-hot-loader'; |
4 | 9 |
|
5 | 10 | import ExampleContainer from 'web-containers/ExampleContainer'; |
6 | 11 | import ProductsTableContainer from 'web-containers/ProductsTableContainer'; |
7 | 12 |
|
8 | | -import {Route, Router, Switch} from 'react-router' |
9 | | -import createHistory from 'history/createBrowserHistory' |
10 | | -import HomeComponent from 'web-components/HomeComponent' |
11 | | -import ErrorComponent from 'web-components/ErrorComponent' |
| 13 | +import { |
| 14 | + Route, Router, Switch, |
| 15 | +} from 'react-router' |
12 | 16 |
|
| 17 | +import createHistory from 'history/createBrowserHistory'; |
| 18 | +import HomeComponent from 'web-components/HomeComponent'; |
| 19 | +import ErrorComponent from 'web-components/ErrorComponent'; |
13 | 20 |
|
14 | 21 |
|
15 | 22 | const browserHistory = createHistory(); |
16 | 23 |
|
17 | 24 |
|
18 | | - |
19 | 25 | const Base: StatelessFunctionalComponent<*> = (): Node => ( |
20 | 26 | <div> |
21 | 27 | <Router history={browserHistory}> |
22 | | - <Switch> |
23 | | - <Route path='/' component={HomeComponent} exact/> |
24 | | - <Route path='/products' render={() => <ProductsTableContainer browserHistory={browserHistory}/>}/> |
25 | | - <Route path='/generator' render={() => <ExampleContainer browserHistory = {browserHistory}/>}/> |
26 | | - <Route component={ErrorComponent}/> |
27 | | - </Switch> |
| 28 | + <Switch> |
| 29 | + <Route path="/" component={HomeComponent} exact /> |
| 30 | + <Route path="/products" render={() => <ProductsTableContainer browserHistory={browserHistory} />} /> |
| 31 | + <Route path="/generator" render={() => <ExampleContainer browserHistory={browserHistory} />} /> |
| 32 | + <Route component={ErrorComponent} /> |
| 33 | + </Switch> |
28 | 34 | </Router> |
29 | 35 | </div> |
30 | 36 | ); |
|
0 commit comments