app/containers/App/index.js
// @flow
import * as React from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import ErrorBoundary from 'components/ErrorBoundary';
import Header from 'components/Header';
import Budget from 'routes/Budget';
import Reports from 'routes/Reports';
import './style.scss';
const AppError = React.lazy(() => import('components/AppError' /* webpackChunkName: "error-msg" */));
const App = () => (
<ErrorBoundary fallbackComponent={AppError}>
<main>
<Header />
<Switch>
<Route path="/budget" component={Budget} />
<Route path="/reports" component={Reports} />
<Redirect to="/budget" />
</Switch>
</main>
</ErrorBoundary>
);
export default App;