-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (26 loc) · 919 Bytes
/
index.js
File metadata and controls
34 lines (26 loc) · 919 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
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import createHistory from 'history/createBrowserHistory';
import { ConnectedRouter, routerReducer, routerMiddleware } from 'react-router-redux';
import reducers from './reducers';
import './normalize.css';
import './index.css';
import { AppWithRouter } from './App';
import registerServiceWorker from './registerServiceWorker';
const history = createHistory();
const middleware = routerMiddleware(history);
const store = createStore(
combineReducers({ ...reducers, router: routerReducer }),
applyMiddleware(middleware)
);
ReactDOM.render(
<Provider store={ store }>
<ConnectedRouter history={ history }>
<AppWithRouter />
</ConnectedRouter>
</Provider>
, document.getElementById('root')
);
registerServiceWorker();