Warning: [antd: Form.Item] `children` is array of render props cannot have `name`.

See original GitHub issue
<Form.Item
        name="agreement"
        valuePropName="checked"
        rules={[
          { validator:(_, value) => value ? Promise.resolve() : Promise.reject('Should accept agreement') },
        ]}
        {...tailFormItemLayout}
      >
        <Checkbox>
          I have read the <a href="">agreement</a>
        </Checkbox>
      </Form.Item>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

67reactions
samkahchiincommented, Jul 1, 2020

@xyy7260 I guess it is because data binding is tied to a Form.Item with name key and wraps only an Input. Therefore if you have additional elements alongside the Input, such as a custom label element, you’ll have to nest Form.Items. Check the documentations => https://ant.design/components/form/#components-form-demo-complex-form-control

24reactions
SulePostarcommented, Jul 27, 2021

Hello XXX, your issue has been closed because it does not conform to our issue requirements. It seems like a good answer for any issue you have no idea how to solve ???

Read more comments on GitHub >

github_iconTop Results From Across the Web

ant-design/ant-design-english - Gitter
Item name key when mapping over a list to create inputs: Warning: [antd: Form.Item] `children` is array of render props cannot have `name`....
Read more >
[antd: Form.Item] `children` is array of render props ... - Issuehunt
Item cannot contain h5 element, has error --> index.js:1 Warning: [antd: Form.Item] `children` is array of render props cannot have `name` #27570.
Read more >
[antd: Form.Item] `children` is array of render ... - CodeSandbox
[antd: Form. Item] `children` is array of render props cannot have `name` - CodeSandbox.
Read more >
antd Form.Item accepts only one child - Stack Overflow
I found a solution and have a better understanding now of what is going on. From the docs (https://ant.design/components/form/#Form.Item):.
Read more >
[antd: Form.Item] `children` is array of render props cannot ...
react+antd form 警告Warning: [antd: Form.Item] `children` is array of render props cannot have `name`. luffy5459 于 2020-07-14 15:01:17 发布 20913 收藏 5.
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