Closed zacdemi closed 3 years ago
Can you provide your configuration for the createDebugger
of redux- flipper middleware in your application?
If possible, can you also provide an example action type you trigger the error?
Yes, thanks.
import { createStore, applyMiddleware, combineReducers } from 'redux';
import logger from 'redux-logger';
import { composeWithDevTools } from 'redux-devtools-extension';
import thunk from 'redux-thunk';
import * as reducers from '../reducers';
const middlewares = [];
if (process.env.REACT_APP_NODE_ENV !== 'production') {
const createDebugger = require('redux-flipper').default;
middlewares.push(createDebugger(), thunk, logger);
} else {
middlewares.push(thunk);
}
const appReducer = combineReducers({ ...reducers });
const rootReducer = (state, action) => {
let nextState = state;
if (action.type === 'USER_LOGOUT') {
nextState = undefined;
}
return appReducer(nextState, action);
};
const store = createStore(
rootReducer,
composeWithDevTools(applyMiddleware(...middlewares)),
);
export default store;
And it happens when this action is triggered.
export const setCurrentMode = mode => async dispatch => {
await AsyncStorage.setItem('current_mode', mode);
return dispatch({
type: sessionTypes.SET_CURRENT_MODE,
payload: { mode },
});
};
This is fixed in version 2.0.0