-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (29 loc) · 907 Bytes
/
index.js
File metadata and controls
35 lines (29 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { ConnectedRouter } from 'react-router-redux';
import createHistory from 'history/createBrowserHistory';
import configureStore from './config/configureStore';
import App from './components/App';
import './index.css';
const history = createHistory();
const store = configureStore(undefined, history);
const render = Component => {
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<Component />
</ConnectedRouter>
</Provider>,
document.getElementById('root'),
);
};
/* istanbul ignore if */
if (process.env.NODE_ENV === 'development' && module.hot) {
module.hot.accept('./components/App', () => {
// eslint-disable-next-line
const NextApp = require("./components/App").default;
render(NextApp);
});
}
render(App);