caremyway-client/src/index.js

41 lines
999 B
JavaScript

import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter } from "react-router-dom";
import { Provider } from "react-redux";
import configureStore from "./store";
import App from "./components/App";
import { unregister } from "./registerServiceWorker";
const store = configureStore();
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();