Skip to content

Commit

Permalink
fix(list): 修复ProFormList透传部分属性到FormItem中导致的react警告 (#8051)
Browse files Browse the repository at this point in the history
具体属性为containerClassName、containerStyle、readonly。解决方案是将其从props中解构出来并调整对应使用的地方
  • Loading branch information
SANmq committed Jan 7, 2024
1 parent a2be303 commit ebc08bf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/form/src/components/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ function ProFormList<T>(props: ProFormListProps<T>) {
isValidateList = false,
emptyListMessage = '列表不能为空',
className,
containerClassName,
containerStyle,
readonly,
...rest
} = props;

Expand Down Expand Up @@ -244,7 +247,7 @@ function ProFormList<T>(props: ProFormListProps<T>) {
<RowWrapper>
<ProFormListContainer
name={name}
readonly={!!rest.readonly}
readonly={!!readonly}
originName={rest.name}
copyIconProps={copyIconProps}
deleteIconProps={deleteIconProps}
Expand Down Expand Up @@ -280,8 +283,8 @@ function ProFormList<T>(props: ProFormListProps<T>) {
}
onAfterRemove?.(index, count);
}}
containerClassName={props.containerClassName}
containerStyle={props.containerStyle}
containerClassName={containerClassName}
containerStyle={containerStyle}
>
{children}
</ProFormListContainer>
Expand Down

0 comments on commit ebc08bf

Please sign in to comment.