ant-design Default value for List's add operation deleted when strictmode and preserve is false

hgqdbh6s  于 5个月前  发布在  其他
关注(0)|答案(4)|浏览(62)

Steps to reproduce

create a list form
add <StrictMode>
add preserve={false} to the form
add default value for the add operation

What is expected?

adds a list item with the default value

What is actually happening?

default value gets deleted
| Environment | Info |
| ------------ | ------------ |
| antd | 5.19.0 |
| React | 18.3.1 |
| System | Windows 11 |
| Browser | Chrome 126.0 |

I think form has a bug with useEffect

siv3szwd

siv3szwd2#

It should be a bug with field-form.

2fjabf4q

2fjabf4q3#

Problems caused by component uninstallation due to StrictMode

vof42yt1

vof42yt14#

This problem is not easy to handle. It is recommended not to use preserve in strict mode for the time being.

相关问题