From 7bd03b638823dba63db032159da74a4ce6d03d4c Mon Sep 17 00:00:00 2001 From: Takhyun Kim Date: Tue, 10 Oct 2023 19:29:59 +0900 Subject: [PATCH] refactor(button): apply component prop to BaseButtonProps interface --- packages/design-system/src/components/Button/Button.tsx | 4 +--- packages/design-system/src/components/Button/Button.types.ts | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/design-system/src/components/Button/Button.tsx b/packages/design-system/src/components/Button/Button.tsx index 47c30b05..f68671e3 100644 --- a/packages/design-system/src/components/Button/Button.tsx +++ b/packages/design-system/src/components/Button/Button.tsx @@ -4,9 +4,7 @@ import { CustomButton } from "./Button.styled"; import type { ButtonProps } from "./Button.types"; -const Button = ( - props: ButtonProps & { component?: C } -) => { +const Button = (props: ButtonProps) => { const { size = "small", color = "primary", diff --git a/packages/design-system/src/components/Button/Button.types.ts b/packages/design-system/src/components/Button/Button.types.ts index 78493825..32f45969 100644 --- a/packages/design-system/src/components/Button/Button.types.ts +++ b/packages/design-system/src/components/Button/Button.types.ts @@ -1,7 +1,9 @@ import type { ButtonProps as MuiButtonProps } from "@mui/material"; -interface BaseButtonProps extends Omit { +interface BaseButtonProps + extends Omit, "variant"> { icon?: React.ReactNode; + component?: React.ElementType; } interface ContainedButtonProps extends BaseButtonProps {