ReactHotLoader enters an infinite loop?

import 'react-hot-loader/patch';
import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import App from './components/App.jsx';


const render = Component => {
ReactDOM.render(
<appcontainer>
<component>
</component></appcontainer>,
document.getElementById('root')
);
};

render(App);

if (module.hot) {
 module.hot.accept('./components/App.jsx', () => { render(App) });
}


When you go to the page it cannot be closed, it displays only white space in the console of errors is not present, and the DOM tree is empty.

But if you remove it -- all perfectly rendered.
import 'react-hot-loader/patch';

But get the following error and the actual Hot Loader doesn't work:
AppContainer.dev.js?ce78:37 React Hot Loader: It appears that "react-hot-loader/patch" did not run immediately before the app started. Make sure that it runs before any other code. For example, if you use Webpack, you can add "react-hot-loader/patch" as the very first item to the "entry" array in its config. Alternatively, you can add require("react-hot-loader/patch") as the very first line in the application code, before any other imports.
June 10th 19 at 14:22
0 answer

Find more questions by tags WebpackReactJavaScript