mon-entreprise/source/entry.js

36 lines
658 B
JavaScript
Raw Normal View History

2016-06-29 10:27:04 +00:00
import React from 'react'
import { render } from 'react-dom'
import { compose, createStore } from 'redux'
2016-06-29 10:27:04 +00:00
import App from './containers/App'
import reducers from './reducers'
import DevTools from './DevTools'
import { AppContainer } from 'react-hot-loader'
let store = createStore(
reducers,
compose(
DevTools.instrument()
)
)
2016-06-29 10:27:04 +00:00
let anchor = document.querySelector('#js')
render(
2016-07-28 14:01:25 +00:00
<App store={store}/>,
2016-06-29 10:27:04 +00:00
anchor
)
// Hot react component reloading. Unstable but helpful.
2016-06-29 10:27:04 +00:00
if (module.hot) {
module.hot.accept('./containers/App', () => {
render(
<AppContainer>
<App store={store} />
2016-06-29 10:27:04 +00:00
</AppContainer>,
anchor
)
})
}
export {anchor}