Redux开发工具Chrome扩展Immutable.js导致错误
Redux Dev Tools Chrome Extension Immutable.js Causes Error
目前,我的redux设置(使用Immutable.js进行状态设置)完全按需运行。然而,每当打开时,redux开发工具扩展都会输出以下错误:
减速器中出现错误类型错误:n.withMutations不是函数
就上下文而言,我使用redux-immutable作为其组合还原器函数,以组合我的反应路由器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的本地机器上)似乎已经解决了问题?古怪的
如果你想使用react-router-redux
,不需要实现你自己的reducer,只需从react-router-redux
导入routerReducer作为关键路由(重要),如下所示,并与其他Reducer、组合
import { syncHistoryWithStore, routerReducer } from 'react-router-redux'
// Add the reducer to your store on the `routing` key
const store = createStore(
combineReducers({
...reducers,
routing: routerReducer
})
)
//To Sync navigation events with the store
const history = syncHistoryWithStore(browserHistory, store)
ReactDOM.render(
<Provider store={store}>
{ /* Tell the Router to use our enhanced history */ }
<Router history={history}>
<Route path="/" component={App}>
<Route path="foo" component={Foo}/>
<Route path="bar" component={Bar}/>
</Route>
</Router>
</Provider>,
document.getElementById('mount')
)
希望这就是您正在尝试实现的
相关文章:
- Node.js v6.2.0类扩展不是函数错误
- 同样,同样的错误'ahorcado.js:26未捕获类型错误:无法读取属性'beginPath'
- RxJS:在循环中处理错误.js自定义驱动程序
- 如何在快递中抛出 404 错误.js
- 如何捕获服务器错误 JS
- 帆的“500”错误.js“测试项目”
- 快递中的会话未定义错误.js
- jquery.validate 中的错误.js“javaScript 运行时错误:无法获取未定义或空引用的属性'
- 角度动画中的奇怪错误.js
- 如何删除“对象在节点中没有方法'forEach'错误.js”
- 错误 JS 将发布数据发送到控制器 -CodeIgniter
- 使用摩卡在节点上测试错误.js函数
- 为什么 Magento js/varien/form.js IE 中的错误 - js fiddle
- 检测导致冻结等问题的错误 JS
- 三中的错误.js:相机不是三的实例.照相机
- 编译错误js.72.未处理的错误
- PHP停止表单重新加载显示错误Js
- 节点中的套接字挂断错误.js使用 https 时
- 纹理加载错误(JS动画)
- jasmineNodeOpts:执行量角器时出现意外的标识符错误.js