Refactor Button component to remove unnecessary local variables for variant and size, directly using props instead.

This commit is contained in:
Valentin Palkovic 2025-03-28 11:18:00 +01:00
parent 8323d2c405
commit adf2703a3d

View File

@ -36,8 +36,6 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
if (asChild) { if (asChild) {
Comp = Slot; Comp = Slot;
} }
const localVariant = variant;
const localSize = size;
const [isAnimating, setIsAnimating] = useState(false); const [isAnimating, setIsAnimating] = useState(false);
@ -65,8 +63,8 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
<StyledButton <StyledButton
as={Comp} as={Comp}
ref={ref} ref={ref}
variant={localVariant} variant={variant}
size={localSize} size={size}
padding={padding} padding={padding}
disabled={disabled} disabled={disabled}
active={active} active={active}