首页 > 解决方案 > 有没有办法明确设置 React Final-Form 脏?

问题描述

我有一个编辑对象的表单,其中正在编辑的对象看起来像

{
  description: '',
  details: {
    array_one: [
      { description: 'this type of thing', count: 1},
      { description: 'that type of thing', count: 42}
    ],
    array_two: []
  }
}

我在 Form 中有动态创建的子组件<input type="text">,它们要么修改数组中的对象,要么将新对象附加到数组中。子组件当前不包含在<Field>元素中。

我正在寻找一种让表单被视为脏并在其中一个数组或包含的项目的内容被修改时启用提交按钮的方法。

这可以做到吗?

标签: reactjsreact-final-form

解决方案


推荐阅读