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