Skip to content

Commit

Permalink
type: fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Dec 31, 2024
1 parent 8db90a4 commit 43cd922
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/BaseInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ const BaseInput = React.forwardRef<HolderRef, BaseInputProps>((props, ref) => {

let element: ReactElement = cloneElement(inputElement as ReactElement<any>, {
value,
className: clsx(
(inputElement as ReactElement<any>).props?.className,
!hasAffix && classNames?.variant,
),
className:
clsx(
(inputElement as ReactElement<any>).props?.className,
!hasAffix && classNames?.variant,
) || null,
});

// ======================== Ref ======================== //
Expand Down Expand Up @@ -193,7 +194,8 @@ const BaseInput = React.forwardRef<HolderRef, BaseInputProps>((props, ref) => {

// `className` and `style` are always on the root element
return React.cloneElement(element as ReactElement<any>, {
className: clsx((element as ReactElement<any>).props?.className, className),
className:
clsx((element as ReactElement<any>).props?.className, className) || null,
style: {
...(element as ReactElement<any>).props?.style,
...style,
Expand Down

0 comments on commit 43cd922

Please sign in to comment.