redux-form FieldArray 修改 props

redux-form FieldArray modifies props

我试图找到一个用于我的表单、处理验证和其他内容的库,我遇到了 redux-form,它似乎是最受欢迎的。

不过有一件事让我很烦恼。在 FieldArray 示例 https://redux-form.com/7.2.3/examples/fieldarrays/ 中,他们将 props 修改为 add/remove 字段。这不是与函数式编程原则相冲突的反模式吗?

来自文档:https://redux-form.com/7.3.0/docs/api/fieldarray.md/

fields.push(value:Any) : Function

Adds a value to the end of the array. Returns nothing.

This is not a mutator; it dispatches an action which updates the state in Redux, which will cause your component to rerender.