web client v 0.1
This commit is contained in:
15
src/index.js
15
src/index.js
@@ -5,23 +5,30 @@ import { Provider } from "react-redux";
|
||||
import "./index.scss";
|
||||
import App from "./App";
|
||||
import * as serviceWorker from "./serviceWorker";
|
||||
import rootReducer from "./reducers";
|
||||
import thunk from "redux-thunk";
|
||||
import { createBrowserHistory } from "history";
|
||||
import { createStore, applyMiddleware, compose } from "redux";
|
||||
import { routerMiddleware, ConnectedRouter } from "connected-react-router";
|
||||
import rootReducer from "./reducers";
|
||||
|
||||
const history = createBrowserHistory();
|
||||
|
||||
ReactGA.initialize("G-SHB9LXPWWM");
|
||||
ReactGA.pageview("/");
|
||||
|
||||
const store = createStore(
|
||||
rootReducer,
|
||||
rootReducer(history),
|
||||
compose(
|
||||
applyMiddleware(thunk),
|
||||
applyMiddleware(routerMiddleware(history), thunk),
|
||||
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
||||
)
|
||||
);
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<App />
|
||||
<ConnectedRouter history={history}>
|
||||
<App history={history} />
|
||||
</ConnectedRouter>
|
||||
</Provider>,
|
||||
document.getElementById("root")
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user