import React from "react" ; import ReactDOM from "react-dom" ; import CssBaseline from "@material-ui/core/CssBaseline" ; import { Provider } from "react-redux" ; import App from "./App" ; import store from "./store" ; import * as serviceWorker from "./serviceWorker" ; import { saveState } from "./localStorage" ; import { SettingsState } from "./reducers/settingsReducer" ; let currentSettings = undefined ; store . subscribe ( ( ) => { const prevSettings = currentSettings ; currentSettings = store . getState ( ) . settings ; if ( prevSettings !== currentSettings ) { saveState ( store . getState ( ) ) ; } } ) ; ReactDOM . render ( < React . StrictMode > < CssBaseline /> < Provider store = { store } > < App /> < /Provider> < /React.StrictMode>, document.getElementById("root")); serviceWorker . unregister ( ) ;