Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e1e2825

Browse files
committedNov 27, 2024·
fix: logic adjust
1 parent 9345d54 commit e1e2825

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/Field.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ function WrapperField<Values = any>({ name, ...restProps }: FieldProps<Values>)
689689
const listContext = React.useContext(ListContext);
690690
const namePath = name !== undefined ? getNamePath(name) : undefined;
691691

692-
const isMergedListField = !!listContext || restProps.isList;
692+
const isMergedListField = restProps.isListField ?? !!listContext;
693693

694694
let key: string = 'keep';
695695
if (!isMergedListField) {
@@ -701,7 +701,7 @@ function WrapperField<Values = any>({ name, ...restProps }: FieldProps<Values>)
701701
if (
702702
process.env.NODE_ENV !== 'production' &&
703703
restProps.preserve === false &&
704-
isMergedListField &&
704+
restProps.isListField &&
705705
namePath.length <= 1
706706
) {
707707
warning(false, '`preserve` should not apply on Form.List fields.');

0 commit comments

Comments
 (0)
Please sign in to comment.