-
-
Save gaearon/06bd9e2223556cb0d841 to your computer and use it in GitHub Desktop.
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
var App = require('./App') | |
var React = require('react') | |
var ReactDOM = require('react-dom') | |
// Render the root component normally | |
var rootEl = document.getElementById('root') | |
ReactDOM.render(<App />, rootEl) | |
// Are we in development mode? | |
if (module.hot) { | |
// Whenever a new version of App.js is available | |
module.hot.accept('./App', function () { | |
// Require the new version and render it instead | |
var NextApp = require('./App') | |
ReactDOM.render(<NextApp />, rootEl) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
React Native version would be nice.