From 521223d53b4c834f5f1fd8069602aec77f3abbc4 Mon Sep 17 00:00:00 2001 From: jinhojang6 Date: Fri, 10 Mar 2023 00:06:42 +0900 Subject: [PATCH] refactor: use _name in case of radio button group is not being used --- packages/lsd-react/src/components/RadioButton/RadioButton.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/lsd-react/src/components/RadioButton/RadioButton.tsx b/packages/lsd-react/src/components/RadioButton/RadioButton.tsx index ed49ac2..ca87974 100644 --- a/packages/lsd-react/src/components/RadioButton/RadioButton.tsx +++ b/packages/lsd-react/src/components/RadioButton/RadioButton.tsx @@ -30,6 +30,7 @@ export const RadioButton: React.FC & { defaultChecked, disabled = false, value, + name: _name, inputProps = {}, children, ...props @@ -38,7 +39,7 @@ export const RadioButton: React.FC & { const radioButtonGroup = useRadioButtonGroupContext() const size = radioButtonGroup?.size ?? _size - const name = radioButtonGroup?.name ?? '' + const name = radioButtonGroup?.name ?? _name ?? '' const selected = radioButtonGroup ? radioButtonGroup.value === value : _checked