mon-entreprise/source/entry.js

39 lines
827 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', () => {
// If you use Webpack 2 in ES modules mode, you can
// use <App /> here rather than require() a <NextApp />.
const NextApp = require('./containers/App').default
render(
<AppContainer>
<NextApp store={store} />
</AppContainer>,
anchor
)
})
}
export {anchor}