mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 06:11:11 +08:00
Refactor Button component to remove unnecessary local variables for variant and size, directly using props instead.
This commit is contained in:
parent
8323d2c405
commit
adf2703a3d
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user