2017-08-29 22:55:44 +00:00
|
|
|
import React from "react";
|
|
|
|
import ReactDOM from "react-dom";
|
|
|
|
import { BrowserRouter } from "react-router-dom";
|
|
|
|
import { Provider } from "react-redux";
|
|
|
|
|
2017-08-30 01:51:45 +00:00
|
|
|
import configureStore from "./store";
|
2017-08-29 22:55:44 +00:00
|
|
|
import App from "./components/App";
|
|
|
|
import { unregister } from "./registerServiceWorker";
|
|
|
|
|
2017-08-30 01:51:45 +00:00
|
|
|
const store = configureStore();
|
2017-08-29 22:55:44 +00:00
|
|
|
const supportsHistory = "pushState" in window.history;
|
|
|
|
|
|
|
|
const rootElement = document.getElementById("root");
|
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<Provider store={store}>
|
|
|
|
<BrowserRouter forceRefresh={!supportsHistory}>
|
|
|
|
<App />
|
|
|
|
</BrowserRouter>
|
|
|
|
</Provider>,
|
|
|
|
rootElement
|
|
|
|
);
|
|
|
|
|
|
|
|
// hot module reloading
|
|
|
|
if (module.hot) {
|
|
|
|
module.hot.accept("./components/App", () => {
|
|
|
|
const NextApp = require("./components/App").default;
|
|
|
|
ReactDOM.render(
|
|
|
|
<Provider store={store}>
|
|
|
|
<BrowserRouter forceRefresh={!supportsHistory}>
|
|
|
|
<NextApp />
|
|
|
|
</BrowserRouter>
|
|
|
|
</Provider>,
|
|
|
|
rootElement
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// no service worker functionality for now
|
|
|
|
unregister();
|