diff --git a/src/components/commons/button/Button.tsx b/src/components/commons/button/Button.tsx index 5eeb32c1..09f25fd0 100644 --- a/src/components/commons/button/Button.tsx +++ b/src/components/commons/button/Button.tsx @@ -6,14 +6,20 @@ export type ButtonVariantTypes = "primary" | "line" | "gray" | "blue"; //React.ButtonHTMLAttributes는 버튼 속성에 집중하긴 했지만, 제네릭 타입이다. export interface ButtonProps extends React.ButtonHTMLAttributes { - size: ButtonSizeTypes; - variant: ButtonVariantTypes; + size?: ButtonSizeTypes; + variant?: ButtonVariantTypes; children: ReactNode; //자식 노드(텍스트)를 받기 위해 필수. onClick?: React.MouseEventHandler; //MouseEvent와는 상이 } //disabled는 버튼의 기본 속성(따라서 위의 interface에서 명시되어 있지는 않다.) -const Button = ({ onClick, size, disabled, variant, children }: ButtonProps) => { +const Button = ({ + onClick, + size = "xlarge", + disabled, + variant = "primary", + children, +}: ButtonProps) => { return ( { navigate("/"); }; - const [isNothing, setIsNothing] = useState(false); + const [isNothing, setIsNothing] = useState(false); return ( <>