title: Redux-persist is not working: Page refresh clears the state
body: <p>To persist the state when the page is refreshed, I am trying to integrate <code>redux-persist</code>. However, it is not working. Page refresh clears the state. Here is how <code>_persist</code> object int the state looks:</p>
  
  <pre><code>_persist: {
     version: -1,
     rehydrated: true
  }
  </code></pre>
  
  <p>Here is the configureStore.js:</p>
  
  <pre><code>import { createStore, applyMiddleware, compose } from "redux";
  import logger from "redux-logger";
  import thunk from "redux-thunk";
  import rootReducer from "./_reducers/rootReducer";
  import storage from "redux-persist/lib/storage";
  import { persistStore, persistReducer } from "redux-persist";
  const persistConfig = {
      key: "root",
      storage,
      whitelist: []
  };
  const persistedReducer = persistReducer(persistConfig, rootReducer);
  const middlewares = [thunk];
  // if (__DEV__) react native check dev
  middlewares.push(logger);
  
  const store = createStore(
      persistedReducer,
      {},
      compose(
          applyMiddleware(...middlewares),
          window.devToolsExtension ? window.devToolsExtension() : f =&gt; f)
  );
  const persistor = persistStore(store);
  
  export { store, persistor };
  </code></pre>
  
  <p>And, here is the <code>index.js</code></p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import { Router } from 'react-router-dom';
  import App from './App';
  import registerServiceWorker from './registerServiceWorker';
  
  import { Provider } from 'react-redux';
  
  import { PersistGate } from "redux-persist/lib/integration/react";
  import { store, persistor } from "./configureStore";
  
  
  
  const baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');
  const rootElement = document.getElementById('root');
  
  ReactDOM.render(
      &lt;Router basename={baseUrl} history={history}&gt;
          &lt;Provider store={store}&gt;
              &lt;PersistGate loading={null} persistor={persistor}&gt;
                  &lt;App /&gt;
              &lt;/PersistGate&gt;
          &lt;/Provider&gt;
      &lt;/Router&gt;,
      rootElement);
  
  registerServiceWorker();
  </code></pre>
  
  <p>I cannot figure out the problem with the code. Any help?</p>