Skip to content

Commit

Permalink
fix: classname use repeatedly (#6278)
Browse files Browse the repository at this point in the history
  • Loading branch information
1587315093 authored Aug 1, 2023
1 parent 4cf67a3 commit bed51d6
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/components/form/form-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ type FormItemLayoutProps = Pick<

const FormItemLayout: React.FC<FormItemLayoutProps> = props => {
const {
className,
style,
extra,
label,
Expand Down Expand Up @@ -208,15 +207,10 @@ const FormItemLayout: React.FC<FormItemLayoutProps> = props => {
prefix={layout === 'horizontal' && labelElement}
extra={extra}
description={description}
className={classNames(
classPrefix,
className,
`${classPrefix}-${layout}`,
{
[`${classPrefix}-hidden`]: hidden,
[`${classPrefix}-has-error`]: props.errors.length,
}
)}
className={classNames(classPrefix, `${classPrefix}-${layout}`, {
[`${classPrefix}-hidden`]: hidden,
[`${classPrefix}-has-error`]: props.errors.length,
})}
disabled={disabled}
onClick={props.onClick}
clickable={props.clickable}
Expand All @@ -239,7 +233,6 @@ const FormItemLayout: React.FC<FormItemLayoutProps> = props => {
export const FormItem: FC<FormItemProps> = props => {
const {
// 样式相关
className,
style,
// FormItem 相关
label,
Expand Down Expand Up @@ -335,7 +328,6 @@ export const FormItem: FC<FormItemProps> = props => {
return withNativeProps(
props,
<FormItemLayout
className={className}
style={style}
label={label}
extra={extra}
Expand Down

0 comments on commit bed51d6

Please sign in to comment.