reactjs - React-redux with immer 在调度中检测到状态突变,在路径中
问题描述
我对反应很陌生,所以这里可能有些愚蠢。我正在使用 immer 来生成下一个状态,但是在尝试初始化操作时出现此错误
function updateCondition(state,action) {
const nextState = produce(state, draftState => {
draftState.rules[action.ruleIndex].conditions[action.conditionIndex][0] = action.value;
draftState.rules[action.ruleIndex].conditions[action.conditionIndex][0].ops = {
displayName: -1,
type : "none"
}
});
return nextState;
}
解决方案
推荐阅读
- python - 为什么在 Mac 上尝试安装“pip install ball”时总是出错
- node.js - Node.js 更新文档失败时,最好是抛出异常还是返回信息?
- html - 社交媒体李悬停效果
- amazon-web-services - 如何从 Ansible 中的主机变量中获取值?
- discord.js - 如何从数组中获取多个元素?
- javascript - 如何在 JavaScript 的 if 语句中调用函数?
- uppaal - UPPAAL - 关于频道相关属性的查询
- javascript - jQuery .attr() 与 .prop()
- postgresql - CircleCI 与 Postgres - 无法连接
- react-native - React Native - 使用 Moment.js 自定义日期格式