Form dynamic setFields Error

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://3x.ant.design/components/form-cn/#components-form-demo-dynamic-form-item

Steps to reproduce

{getFieldDecorator(names[${k}], { validateTrigger: [‘onChange’, ‘onBlur’], rules: [ { required: true, whitespace: true, message: “Please input passenger’s name or delete this field.”, }, ],

this.props.form.setFields({ names:{ value:[1,1], errors:[new Error(‘test’)] } });

对 names 使用 setFields 会报错 Warning: You cannot set a form field before rendering a field associated with the value.

What is expected?

setFields 可以对 数组形式的装饰字段使用

What is actually happening?

对 names 使用 setFields 会报错 Warning: You cannot set a form field before rendering a field associated with the value.

Environment Info
antd 3.26.12
React 16.6
System mac
Browser chrome

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
afc163commented, Mar 7, 2020
0reactions
yanlee26commented, Sep 30, 2020

not work yet codepen.io

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ant Design. How to set form field error message dynamically?
the syntax is updated in v4. new syntax is: setFields. | Set fields status | (fields: FieldData[]) => void. example : form.
Read more >
Form - Ant Design
High performance Form component with data scope management. Including data collection, verification, and styles.
Read more >
Ant Design. How To Set Form Field Error Message Dynamically
A form consists of one or more form fields whose type includes input, textarea, checkbox, radio, Ask questionsForm dynamic setFields Error. [x] I...
Read more >
Form.Item set dynamic error - Code Examples & Solutions For ...
formChange.setFields([ { name: 'inputFieldName', errors: ['Mi primer error Zelene', 'Mi segunda posible caía Jazmín'] } ]);
Read more >
useForm - setValue - React Hook Form
This function allows you to dynamically set the value of a registered field ... Whether to compute if your input is valid or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found