javascript - Redux Form 和 Immutable 的未捕获类型错误

标签 javascript reactjs immutability redux-form

当我将 redux-form@7.0.4immutable@3.8.1 一起使用时,我得到:

Uncaught TypeError: (0 , _immutable.isCollection) is not a function

也试过版本:

redux-form@7.1.0 with immutable@3.8.2,
redux-form@7.0.4 with immutable@3.8.2,
redux-form@7.1.0 with immutable@4.0.0-rc.7

我正在使用 React16。

最佳答案

根据@NarasimhaReddy 的评论:

https://github.com/erikras/redux-form/issues/3488

Redux-form@7.10.0 需要 immutable@4.0.0-rc.7 或更高版本。 它引入了一项重大更改,使其与 immutable@3.8.2 不兼容

真正的罪魁祸首是应用 semantic versioning 的错误. 如果你的依赖定义为 "redux-form": "^7.0.4",那么 npm 期望它可以使用 7.0.4 - 之间的任何版本8.0.0

当您运行 npm install 时,它将获取此范围内的最新版本,预计不会有任何重大更改。

关于javascript - Redux Form 和 Immutable 的未捕获类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46665388/

相关文章:

c# - Microsoft.Bcl.不可变 : Create Dictionary based on IImmutableDictionary

Javascript 正则表达式 : match 2 substrings in any order

javascript - 使用javascript将特殊字符转换回HTML实体代码

javascript - React/MUI Popover 使用 anchorPosition 定位不正确

javascript - 从商店发货后获取数据

Swift 使方法参数可变?

javascript - Angular2渲染器: Svg rect is rendered but not showing in page

javascript - 更新注入(inject)的服务后刷新 AngularJS 过滤器

javascript - 无法在 material-ui Button 组件中读取 null 的属性(读取 'pulsate')

Kotlin:val mutableList与var immutableList。什么时候使用?