Redux-persist: (0 , _reduxPersist.autoRehydrate) is not a function

Created on 22 Mar 2018  路  1Comment  路  Source: rt2zz/redux-persist

This is my store

import {navigationReducer} from "../router/NavigationReducer";
import {loadingReducer} from "./loading/LoadingReducer";
import {i18nReducer} from "./i18n/i18nReducer";
import {combineReducers, createStore, applyMiddleware, compose} from 'redux';
import thunkMiddleware from 'redux-thunk';
import {createLogger} from 'redux-logger'
import devTools from 'remote-redux-devtools';
import { persistStore, autoRehydrate } from 'redux-persist'
import {AsyncStorage} from 'react-native'

// middleware that logs actions
const loggerMiddleware = createLogger({ predicate: (getState, action) => __DEV__  });

let reducer = combineReducers({
    nav: navigationReducer,
    loadingState: loadingReducer,
    i18n: i18nReducer
});

function configureStore(initialState) {
    const store = createStore(
        reducer,
        initialState,
        compose(
            applyMiddleware(
              thunkMiddleware,
              loggerMiddleware
            ),
            autoRehydrate(),
            devTools()
        )
    )
    persistStore(store, {storage: AsyncStorage});
    return store;
}

export const store = configureStore();

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamesone picture jamesone  路  4Comments

admbtlr picture admbtlr  路  3Comments

HeratPatel1 picture HeratPatel1  路  3Comments

thenewt15 picture thenewt15  路  3Comments

therise3107 picture therise3107  路  3Comments