Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form.List with required Form.Items bug #50140

Closed
bohdan-krupa opened this issue Jul 29, 2024 · 1 comment
Closed

Form.List with required Form.Items bug #50140

bohdan-krupa opened this issue Jul 29, 2024 · 1 comment
Labels
🤔 Need Reproduce We cannot reproduce your problem unconfirmed

Comments

@bohdan-krupa
Copy link

Reproduction link

https://github.com/ant-design/ant-design/blob/master/components/form/demo/dynamic-form-items-complex.tsx

Steps to reproduce

  1. Copy the code
  2. Add rules={[{ required: true }]} to "first" or "second" Form.Item

What is expected?

Warning: Encountered two children with the same key, ``. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
at CSSMotionList (http://localhost:3000/static/js/bundle.js:43292:92)
at div
at DomWrapper (http://localhost:3000/static/js/bundle.js:43423:90)
at http://localhost:3000/static/js/bundle.js:43125:32
at ErrorList (http://localhost:3000/static/js/bundle.js:18720:5)
at div
at div
at http://localhost:3000/static/js/bundle.js:21106:42
at FormItemInput (http://localhost:3000/static/js/bundle.js:19586:5)
at div
at http://localhost:3000/static/js/bundle.js:21255:18
at div
at ItemHolder (http://localhost:3000/static/js/bundle.js:19030:7)
at InternalFormItem (http://localhost:3000/static/js/bundle.js:19325:5)
at div
at div
at http://localhost:3000/static/js/bundle.js:17819:18
at div
at Field (http://localhost:3000/static/js/bundle.js:36999:90)
at WrapperField (http://localhost:3000/static/js/bundle.js:37545:20)
at List (http://localhost:3000/static/js/bundle.js:37910:19)
at FormList (http://localhost:3000/static/js/bundle.js:19834:18)
at form
at Form (http://localhost:3000/static/js/bundle.js:37667:19)
at FormProvider (http://localhost:3000/static/js/bundle.js:37831:31)
at FormProvider
at DisabledContextProvider (http://localhost:3000/static/js/bundle.js:18493:5)
at InternalForm (http://localhost:3000/static/js/bundle.js:18844:62)
at App (http://localhost:3000/static/js/bundle.js:86:63)
at Router (http://localhost:3000/static/js/bundle.js:79689:15)
at HashRouter (http://localhost:3000/static/js/bundle.js:77708:5)

What is actually happening?

Warning: Encountered two children with the same key, ``. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
at CSSMotionList (http://localhost:3000/static/js/bundle.js:43292:92)
at div
at DomWrapper (http://localhost:3000/static/js/bundle.js:43423:90)
at http://localhost:3000/static/js/bundle.js:43125:32
at ErrorList (http://localhost:3000/static/js/bundle.js:18720:5)
at div
at div
at http://localhost:3000/static/js/bundle.js:21106:42
at FormItemInput (http://localhost:3000/static/js/bundle.js:19586:5)
at div
at http://localhost:3000/static/js/bundle.js:21255:18
at div
at ItemHolder (http://localhost:3000/static/js/bundle.js:19030:7)
at InternalFormItem (http://localhost:3000/static/js/bundle.js:19325:5)
at div
at div
at http://localhost:3000/static/js/bundle.js:17819:18
at div
at Field (http://localhost:3000/static/js/bundle.js:36999:90)
at WrapperField (http://localhost:3000/static/js/bundle.js:37545:20)
at List (http://localhost:3000/static/js/bundle.js:37910:19)
at FormList (http://localhost:3000/static/js/bundle.js:19834:18)
at form
at Form (http://localhost:3000/static/js/bundle.js:37667:19)
at FormProvider (http://localhost:3000/static/js/bundle.js:37831:31)
at FormProvider
at DisabledContextProvider (http://localhost:3000/static/js/bundle.js:18493:5)
at InternalForm (http://localhost:3000/static/js/bundle.js:18844:62)
at App (http://localhost:3000/static/js/bundle.js:86:63)
at Router (http://localhost:3000/static/js/bundle.js:79689:15)
at HashRouter (http://localhost:3000/static/js/bundle.js:77708:5)

Environment Info
antd 5.19.3
React 18.2.0
System MacOS
Browser Google Chrome Version 126.0.6478.183 (Official Build) (arm64)
@afc163 afc163 added the 🤔 Need Reproduce We cannot reproduce your problem label Jul 29, 2024
Copy link
Contributor

Hello @bohdan-krupa. Please provide a online reproduction by forking this one or provide a minimal GitHub repository like create-react-app-antd. Issues labeled by Need Reproduce will be closed if no activities in 3 days.

你好 @bohdan-krupa,我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过 fork 这个在线重现案例 ,或者提供一个最小化的 GitHub 仓库(类似 create-react-app-antd)。3 天内未跟进此 issue 将会被自动关闭。

什么是最小化重现,为什么这是必需的?

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce We cannot reproduce your problem unconfirmed
Projects
None yet
Development

No branches or pull requests

2 participants