question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning 'there are more than one `getFieldDecorator` in it.'

See original GitHub issue

Environment(required)

  • antd version:
  • OS and its version:
  • Browser and its version:

What did you do? Please provide steps to re-produce your problem.

I wont FormItem contain more than one component . this case always use. for excampels

       <FormItem label='Age'>
            {getFieldDecorator('Age',  {rules: [{required: true, message: 'Age require' }]})(
              <Input style={{ width: 100 }} size="small" />
            )}
            {getFieldDecorator('AgeUnit',  {rules: [{required: true, message: 'AgeUnit require' }]})(
              <Select allowClear size="small" style={{ width: 65 }}>
              <Option value="year">year</Option>
              <Option value="month">month</Option>
              <Option value="day">day</Option>
            </Select>
            )}
          </FormItem>
 
console waring  `Form.Item` cannot generate `validateStatus` and `help` automatically, while there are more than one `getFieldDecorator` in it.

in this case,how can i do?

以后会支持这种场景吗,去除警告吗,这种场景经常使用,相关联的多个组件在一个formitem内输入。

<!-- e.g. I just imported Button from antd -->

#### What do you expected?

<!-- e.g. It works fine as official website -->

#### What happen?

<!-- e.g. Style is not as expected. (And it will be better to provide screenshot) -->

#### Re-producible online demo

<!-- Please fork http://codepen.io/benjycui/pen/KgPZrE?editors=001 to re-produce you issue -->

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
afc163commented, Feb 26, 2017

API 暂时不会变动。

虽然 FormItem 不能嵌入多个 getFieldDecorator。FormItem 自己还是可以互相嵌套的,你可以看下 https://ant.design/components/form-cn/#components-form-demo-validate-static 这个例子。

image
0reactions
lock[bot]commented, May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning 'there are more than one `getFieldDecorator` in it.'
Warning 'there are more than one `getFieldDecorator` in it.' 问题: ant-design form 警告Warning 'there are more than one getFieldDecorator in it ...
Read more >
Form - Ant Design
A form consists of one or more form fields whose type includes input, textarea, checkbox, radio, select, tag, and more. A form field...
Read more >
Duplicate field names will result in both fields getting edited ...
When I use this.props.form.setFieldsValue to set ant-design form values, I got this warning, is there someone have seen this problem?
Read more >
ant-design/ant-design-english
because function getFieldDecorator only have one props as your input parameter ,but there are more than one Input element in InputGroup, so it...
Read more >
Form - Ant Design
An enterprise-class UI design language and React-based implementation with a set ... A form consists of one or more form fields whose type...
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