Created
February 23, 2020 22:49
Star
You must be signed in to star a gist
Our index.jsx file
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 Root from './root.jsx' | |
ReactDOM.render( | |
<Root/>, | |
document.getElementById('app') | |
); | |
if (module.hot) { | |
// this is necessary for HMR, the only thing we need for the whole app which is nice | |
module.hot.accept('./root.jsx', () => { | |
const NextRootContainer = require('./root.jsx').default; | |
ReactDOM.render(<NextRootContainer/>, document.getElementById('app')); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment