There was an issue when developing locally where the console would show
this error:

> Error: React-Hot-Loader: AppContainer should be patched
This commit is contained in:
Armen Zambrano G 2019-01-15 11:20:16 -05:00
Родитель e170e8cf58
Коммит 8aff0d4b03
2 изменённых файлов: 9 добавлений и 28 удалений

Просмотреть файл

@ -1,9 +0,0 @@
import React from 'react';
import Routes from './routes';
import '../style.css';
// Main component
export default () => (
<Routes />
);

Просмотреть файл

@ -1,29 +1,19 @@
import Raven from 'raven-js';
import { render } from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import { HashRouter } from 'react-router-dom';
import App from './components/app';
import Boundary from './components/errorBoundary';
import Routes from './components/routes';
import './style.css';
if (process.env.NODE_ENV === 'production') {
Raven.config('https://60b05bc4ef794a6c9e30e86e6a316083@sentry.io/300397').install();
}
const root = document.getElementById('root');
const load = () => render(
<AppContainer>
<HashRouter>
<Boundary>
<App />
</Boundary>
</HashRouter>
</AppContainer>,
root,
render(
<HashRouter>
<Boundary>
<Routes />
</Boundary>
</HashRouter>,
document.getElementById('root'),
);
// This is needed for Hot Module Replacement
if (module.hot) {
module.hot.accept('./components/app', load);
}
load();