From 1fbbf18be6c3cdaa85cc156f529ac53c5d90a214 Mon Sep 17 00:00:00 2001 From: hanyugeon Date: Tue, 30 Apr 2024 00:11:08 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20RadioButton=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -value와 label props 분리 --- src/v1/base/RadioButton.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/v1/base/RadioButton.tsx b/src/v1/base/RadioButton.tsx index 2072b61d..219ab84e 100644 --- a/src/v1/base/RadioButton.tsx +++ b/src/v1/base/RadioButton.tsx @@ -1,14 +1,14 @@ import { ComponentPropsWithoutRef, forwardRef, Ref } from 'react'; +type RadioButtonProps = { + label?: string; +} & Omit, 'id' | 'type' | 'className'>; + const BASE_RADIO_BUTTON_CLASSES = 'px-[1.2rem] py-[0.5rem] bg-main-600/[0.18] text-main-900 text-sm font-normal rounded-[2rem] cursor-pointer w-full h-full peer-checked:bg-main-900 peer-checked:text-white'; const RadioButton = ( - { - name, - value, - ...props - }: Omit, 'id' | 'type' | 'className'>, + { name, value, label, ...props }: RadioButtonProps, ref: Ref ) => { return ( @@ -22,7 +22,7 @@ const RadioButton = ( ref={ref} {...props} /> - {value} + {label ?? value} ); };