Closed ncrmro closed 7 years ago
Thanks @ncrmro for this great PR 👍
@lvarayut no problem, this project is great!
I think HMR has a slightly different config now, whoops!
Working on getting something together it looks like a few changes. https://webpack.js.org/guides/hmr-react/#project-config
// ./src/index.js
import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
// AppContainer is a necessary wrapper component for HMR
import App from './components/App';
const render = (Component) => {
ReactDOM.render(
<AppContainer>
<Component/>
</AppContainer>,
document.getElementById('root')
);
};
render(App);
// Hot Module Replacement API
if (module.hot) {
module.hot.accept('./components/App', () => {
render(App)
});
}
That's interesting. Please don't hesitate to send an awesome PR again :)