fix(table): resolve EditableProTable Form.Item shouldUpdate conflict #8986
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
描述
修复 EditableProTable 的 Form.Item 中 shouldUpdate 与 dependencies 的冲突问题。
目前,当使用带有
name
属性的 EditableProTable 时,如果我们想在formItemProps
中使用dependencies
,会出现以下警告:这是因为 EditableProTable 内置的
shouldUpdate
逻辑与dependencies
产生了冲突。解决方案
将默认的
shouldUpdate
移到{...props?.formItemProps}
前面,这样用户的配置就可以覆盖默认值:修改后可以:
shouldUpdate={undefined}
来正常使用dependencies={[name, 'other field']}
shouldUpdate
行为,自行实现 updatedependencies
时不会再有警告使用示例