mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 02:11:07 +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) {
|
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}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user