Create hello world React app with hot module replacement

This commit is contained in:
2017-06-24 19:31:52 -06:00
parent c0774cdcb1
commit 18bae1f3d4
9 changed files with 113 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
import React from 'react';
import ReactDOM from 'react-dom';
import 'react-hot-loader/patch';
import { AppContainer } from 'react-hot-loader';
import App from './app';
const render = Component => {
ReactDOM.render(
<AppContainer>
<Component />
</AppContainer>,
document.getElementById('root')
)
}
render(App)
if (module.hot) {
module.hot.accept('./app', () => { render(App) })
}