This commit is contained in:
crusader 2017-12-18 20:10:20 +09:00
parent 6f7f35317f
commit 90fb76955e

View File

@ -19,6 +19,11 @@ import {
routerMiddleware, routerMiddleware,
} from 'react-router-redux'; } from 'react-router-redux';
import {
createHashHistory,
History,
} from 'history';
import { import {
AppContainer, AppContainer,
} from 'react-hot-loader'; } from 'react-hot-loader';
@ -41,11 +46,13 @@ class WebAppApplication {
public constructor() { public constructor() {
this.container = document.getElementById('appContainer'); this.container = document.getElementById('appContainer');
this.history = createHashHistory();
} }
public async run(): Promise<void> { public async run(): Promise<void> {
try { try {
this.renderLoading(); this.renderLoading();
this.renderApp();
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
@ -100,7 +107,7 @@ class WebAppApplication {
private rederDevelopment(): void { private rederDevelopment(): void {
if (module.hot) { if (module.hot) {
module.hot.accept('./pages/webapp', async () => { module.hot.accept('./pages/webapp', async () => {
const NextApp = (await import('./pages/webapp')).default; const NextApp = (await require('./pages/webapp')).default;
ReactDOM.render( ReactDOM.render(
<AppContainer> <AppContainer>
<Provider store={this.store}> <Provider store={this.store}>