Home > Software engineering >  need to reset a particular field's value using antd form
need to reset a particular field's value using antd form

Time:03-04

I want to reset a field value on the onchange of another field value using antd form. It is based on index.

this.form.resetFields({[`CorName_${index}`]:''})

I tried this, But error occurs. Is there any other way to clear particular index's field?

CodePudding user response:

antd form resetFields only takes array of fields as parameter. Try below code:

form.resetFields([`CorName_${index}`]);
  • Related