-
-
Notifications
You must be signed in to change notification settings - Fork 54.2k
Open
react-component/field-form
#772Labels
🐛 BugAnt Design Team had proved that this is a bug.Ant Design Team had proved that this is a bug.
Description
Reproduction link
https://github.com/yinvoke/form-list-use-watch-bug
Steps to reproduce
- 创建Form.List,并通过useWatch进行监听
- 添加2个元素,例如[1,2]
- 使用Form.List的remove删除第二个元素,此时监听值应该变为[1]
- 通过antd5版本remove后会变为监听值会变为[1],antd6版本remove后监听值会先变为[1,undefined]再变为[1]
What is expected?
useWatch监听值在remove后没有中间的状态,例如[1,2]在remove后直接变为[1],而不是[1,undefined]
What is actually happening?
useWatch监听值在remove后存在含undefined的中间态,例如[1,2]在remove后直接变为[1,undefined]再变为[1]
| Environment | Info |
|---|---|
| antd | 6.1.0 |
| React | 19.2.0 |
| System | macos |
| Browser | chrome |
升级后使用FormList且使用监听的地方会导致异常问题,希望可以恢复antd5默认行为
dosubot
Metadata
Metadata
Assignees
Labels
🐛 BugAnt Design Team had proved that this is a bug.Ant Design Team had proved that this is a bug.