Reputation: 81
I've been working on a react-native app and have been running it on both IOS and Android simulators as well as on devices in debug mode. I've packaged it and signed release versions in preparation for putting into the app store and play stores.
The IOS version seems to work fine, but the Android apk gives me the following error:
"redux-persist: cannot process cyclical state. Consider changing your state structure to have no cycles. Alternatively blacklist the corresponding reducer key. Cycle encountered at key "/feed" with value "[object Object]"."
Can anyone tell me what this means and how to fix it?
I'm using redux-persist and ex-navigation for routing in my main app file as follows:
<Provider store={ store }>
<NavigationProvider context={ navigationContext }>
<StackNavigation id="root" navigatorUID="root" initialRoute={ Router.getRoute('splash') } />
</NavigationProvider>
</Provider>
and my init-store file:
import { AsyncStorage } from 'react-native';
import { createStore, applyMiddleware, compose } from 'redux';
import { createNavigationEnabledStore } from '@exponent/ex-navigation';
import thunkMiddleware from 'redux-thunk';
import devTools from 'remote-redux-devtools';
import { persistStore, autoRehydrate } from 'redux-persist';
import rootReducer from './reducers/';
const createStoreWithNavigation = createNavigationEnabledStore({
createStore,
navigationStateKey: 'navigation'
});
export function initStore (initialState) {
return createStoreWithNavigation(
rootReducer,
initialState,
compose(
applyMiddleware(thunkMiddleware),
autoRehydrate({ log: true }),
devTools()
)
);
}
Upvotes: 5
Views: 331