You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Form.Item 的 name 为数组时 且 preserve=false,shouldUpdate 有具体判断时,有问题 #59044
I reproduced this against current @rc-component/form master with the original nested paths and traced it to the shared @rc-component/util setter rather than Ant Design's Form wrapper.
When preserve={false} unregisters ['a', 'b'], the removeIfUndefined branch clones the root store but deletes from the still-shared nested a object. That mutates prevStore.a, so the next render-prop predicate receives prev.a?.b === next.a?.b === undefined and does not refresh c.
I opened react-component/util#807 with a focused immutable-delete fix and source/reference regression coverage. Cross-package verification with the exact nested A → B → C reproduction:
TypeScript, ESLint, Prettier, ESM/CJS build, and diff checks passed
Once that util fix is merged and released, this Ant Design reproduction should be resolved without a Form-specific workaround.
AI assistance disclosure: Codex was used to inspect the original sandbox, trace the shared-reference mutation, construct the cross-package regression, and run the checks. The behavior and results were verified locally.
This issue has been inactive for more than 14 days without any updates or linked PR. If you are still working on this issue, please provide a progress update. If you are unable to continue, please contact the maintainers for reassignment.
Activity
QDyanbing commentedon Aug 19, 2026
我操作有问题还是改过demo?
QDyanbing commentedon Aug 19, 2026
#59043 是在说一个问题吗?
linxianxi commentedon Aug 19, 2026
看上去不像是一个问题
linxianxi commentedon Aug 19, 2026
你这就是有问题的
ZQDesigned commentedon Aug 19, 2026
@QDyanbing 我简单验证了一下,确实不是相同问题,现象都是切换后
b消失了,但c还留着。总结下根因:
#59043:核心是preserve={false}和initialValues的交互问题。字段卸载时,store 没有直接清掉,而是回退到了initialValues,所以b虽然卸载了,但值还在,导致依赖b的c继续显示。#59044:核心是字段卸载时,依赖字段的shouldUpdate(predicate)没有正确触发重渲染。b被移除后,c外层这层shouldUpdate没命中更新,所以旧的渲染结果被保留下来了。把shouldUpdate改成true后正常,也是因为它会强制重渲染。nrps9909 commentedon Aug 27, 2026
I reproduced this against current
@rc-component/formmaster with the original nested paths and traced it to the shared@rc-component/utilsetter rather than Ant Design's Form wrapper.When
preserve={false}unregisters['a', 'b'], theremoveIfUndefinedbranch clones the root store but deletes from the still-shared nestedaobject. That mutatesprevStore.a, so the next render-prop predicate receivesprev.a?.b === next.a?.b === undefinedand does not refreshc.I opened react-component/util#807 with a focused immutable-delete fix and source/reference regression coverage. Cross-package verification with the exact nested A → B → C reproduction:
password2remains rendered (regression fails)Once that util fix is merged and released, this Ant Design reproduction should be resolved without a Form-specific workaround.
AI assistance disclosure: Codex was used to inspect the original sandbox, trace the shared-reference mutation, construct the cross-package regression, and run the checks. The behavior and results were verified locally.
github-actions commentedon Sep 11, 2026
@ZQDesigned 这个 issue 已经超过 14 天没有更新或关联 PR。如果您仍在处理这个 issue,请更新进度;如果您无法继续处理,请联系维护者重新分配。
This issue has been inactive for more than 14 days without any updates or linked PR. If you are still working on this issue, please provide a progress update. If you are unable to continue, please contact the maintainers for reassignment.