36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
import React from "react";
|
|
import ReactDOM from "react-dom";
|
|
import { Provider } from "react-redux";
|
|
import "./index.scss";
|
|
import App from "./App";
|
|
import * as serviceWorker from "./serviceWorker";
|
|
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();
|
|
|
|
const store = createStore(
|
|
rootReducer(history),
|
|
compose(
|
|
applyMiddleware(routerMiddleware(history), thunk),
|
|
window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() : f => f
|
|
)
|
|
);
|
|
|
|
ReactDOM.render(
|
|
<Provider store={store}>
|
|
<ConnectedRouter history={history}>
|
|
<App history={history} />
|
|
</ConnectedRouter>
|
|
</Provider>,
|
|
document.getElementById("root")
|
|
);
|
|
|
|
// If you want your app to work offline and load faster, you can change
|
|
// unregister() to register() below. Note this comes with some pitfalls.
|
|
// Learn more about service workers: https://bit.ly/CRA-PWA
|
|
serviceWorker.unregister();
|