This is related to v5.
Error file

Store.js
import { persistStore, persistCombineReducers } from 'redux-persist'
import { createStore } from 'redux'
import storage from 'redux-persist/es/storage'
import reducers from './reducers'
const config = {
key: 'root',
storage,
}
const reducer = persistCombineReducers(config, reducers)
const configureStore = () => {
const store = createStore(reducer)
const persistor = persistStore(store)
return { store, persistor }
}
export default configureStore
redcuers/index.js
import { combineReducers } from 'redux'
const initialReducer = (state = [], action) => return state
const reducers = combineReducers({
initialReducer
})
export default reducers
perhaps the docs did not make this clear, but you should not need combineReducers that is handled by persistCombineReducers, so simply change reducers/index.js to be
import { combineReducers } from 'redux'
const initialReducer = (state = [], action) => return state
export default {
initialReducer
}
Open to suggestions for how to improve the docs around this.
Thank you @rt2zz. I'm closing this. Docs are fine just needs some more clarification on usage. I am just starting with redux-persist so I will gladly create PR's in coming days.
@rt2zz What if I want to clear all the stored data?
Most helpful comment
perhaps the docs did not make this clear, but you should not need combineReducers that is handled by persistCombineReducers, so simply change reducers/index.js to be
Open to suggestions for how to improve the docs around this.