2016-06-24 10:22:48 -07:00
|
|
|
import React from 'react'
|
|
|
|
import ReactDOM from 'react-dom'
|
2018-02-21 20:19:56 -05:00
|
|
|
import { AppContainer } from 'react-hot-loader'
|
|
|
|
import App from './app'
|
|
|
|
import './index.css'
|
2016-07-12 22:26:57 -07:00
|
|
|
|
2016-06-24 10:22:48 -07:00
|
|
|
/**
|
2018-02-21 20:19:56 -05:00
|
|
|
* Mount the router.
|
2016-06-24 10:22:48 -07:00
|
|
|
*/
|
|
|
|
|
2018-02-21 20:19:56 -05:00
|
|
|
const root = window.document.createElement('div')
|
|
|
|
root.id = 'root'
|
|
|
|
window.document.body.appendChild(root)
|
|
|
|
|
|
|
|
const render = Component => {
|
|
|
|
ReactDOM.render(
|
|
|
|
<AppContainer>
|
|
|
|
<Component />
|
|
|
|
</AppContainer>,
|
|
|
|
root
|
|
|
|
)
|
2016-06-24 10:22:48 -07:00
|
|
|
}
|
|
|
|
|
2018-02-21 20:19:56 -05:00
|
|
|
render(App)
|
2016-06-24 10:22:48 -07:00
|
|
|
|
2018-02-21 20:19:56 -05:00
|
|
|
// Webpack Hot Module Replacement API
|
|
|
|
if (module.hot) {
|
|
|
|
module.hot.accept('./app', () => render(App))
|
|
|
|
}
|