【发布时间】:2016-08-25 07:26:19
【问题描述】:
目前,我的 redux 设置(它使用 Immutable.js 的状态)完全按照需要运行。但是,redux 开发工具扩展在打开时会输出以下错误:
reducer 发生错误 TypeError: n.withMutations 不是函数
对于上下文,我使用 redux-immutable 来实现它的 combine reducers 功能,好吧,组合我的 react-router-redux reducer:
import { fromJS } from 'immutable';
import { LOCATION_CHANGE } from 'react-router-redux';
const initialState = fromJS({
locationBeforeTransitions: null,
});
export default (state = initialState, action) => {
if (action.type === LOCATION_CHANGE) {
return state.merge({
locationBeforeTransitions: action.payload,
});
}
return state;
};
还有我的业务逻辑减速器。
更新:使用 webpack 构建生产包,在生产模式下测试应用程序(在 docker 容器中),并在开发模式下再次测试应用程序(在没有 docker 的本地机器上)似乎已经解决了问题?奇怪...
【问题讨论】:
-
以下答案是否解决了这个问题?如果足够,您能否更新状态或接受答案
标签: javascript redux immutable.js redux-devtools