перед постом я пытался прочитать супер-ответ Дана Абрамова в этом посте
У меня есть небольшая проблема в моем коде, я буду рад понять мою ошибку:
1) это мой индексный файл
import { combineReducers } from 'redux-immutable';
import { reducer as formReducer } from 'redux-form';
import appReducer from './appReducer';
import errorReducer from './errorReducer';
import loginReducer from './loginReducer';
import modalReducer from './modalReducer';
import changeRequestReducer from './changeRequestReducer';
import releaseReducer from './releaseReducer';
import releaseReviewReducer from './releaseReviewReducer';
import logoutReducer from './logoutReducer';
import customAvatarReducer from './customAvatarReducer';
export default combineReducers({
appReducer,
errorReducer,
loginReducer,
changeRequestReducer,
releaseReducer,
modalReducer,
releaseReviewReducer,
form: formReducer,
logoutReducer,
customAvatarReducer,
});
Я пытался добавить это:
const rootReducer = (state, action) => {
if (action.type === USER_LOGOUT) {
const state = undefined;
}
return reducers(state, action);
};
const reducers = combineReducers({
appReducer,
errorReducer,
loginReducer,
changeRequestReducer,
releaseReducer,
modalReducer,
releaseReviewReducer,
form: formReducer,
logoutReducer,
customAvatarReducer,
});
а это дерево файлов,
Проблема в том, что я получаю сообщение об ошибке "вы достигли максимального размера стека вызовов"
Что я делаю не так? Я не знаю, может ли это быть проблемой, но мы используем Immutable.js
UPDATE
Это ошибка, полученная
и сейчас это индексный файл
import { combineReducers } from 'redux-immutable';
import { reducer as formReducer } from 'redux-form';
import appReducer from './appReducer';
import errorReducer from './errorReducer';
import loginReducer from './loginReducer';
import modalReducer from './modalReducer';
import changeRequestReducer from './changeRequestReducer';
import releaseReducer from './releaseReducer';
import releaseReviewReducer from './releaseReviewReducer';
import logoutReducer from './logoutReducer';
import customAvatarReducer from './customAvatarReducer';
import { USER_LOGOUT } from '../actions/logoutActions';
const rootReducer = (state, action) => {
if (action.type === USER_LOGOUT) {
const state = undefined;
}
return reducers(state, action);
};
const reducers = combineReducers({
appReducer,
errorReducer,
loginReducer,
changeRequestReducer,
releaseReducer,
modalReducer,
releaseReviewReducer,
form: formReducer,
logoutReducer,
customAvatarReducer,
rootReducer,
});
export default reducers;