Created
October 25, 2017 08:03
-
-
Save cezarderevlean/7bb60e752843becd84d00d062600637f to your computer and use it in GitHub Desktop.
HMR index example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { AppContainer } from 'react-hot-loader'; | |
import App from './app/App.jsx'; | |
import './styles/main.scss'; | |
const render = Component => { | |
ReactDOM.render( | |
<AppContainer> | |
<Component /> | |
</AppContainer>, | |
document.getElementById('root') | |
); | |
}; | |
render(App); | |
if (module.hot) { | |
module.hot.accept('./app/App.jsx', () => { render(App); }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment