mirror of https://github.com/acid-info/lsd.git
refactor: use _name in case of radio button group is not being used
This commit is contained in:
parent
5e25a92500
commit
521223d53b
|
@ -30,6 +30,7 @@ export const RadioButton: React.FC<RadioButtonProps> & {
|
||||||
defaultChecked,
|
defaultChecked,
|
||||||
disabled = false,
|
disabled = false,
|
||||||
value,
|
value,
|
||||||
|
name: _name,
|
||||||
inputProps = {},
|
inputProps = {},
|
||||||
children,
|
children,
|
||||||
...props
|
...props
|
||||||
|
@ -38,7 +39,7 @@ export const RadioButton: React.FC<RadioButtonProps> & {
|
||||||
|
|
||||||
const radioButtonGroup = useRadioButtonGroupContext()
|
const radioButtonGroup = useRadioButtonGroupContext()
|
||||||
const size = radioButtonGroup?.size ?? _size
|
const size = radioButtonGroup?.size ?? _size
|
||||||
const name = radioButtonGroup?.name ?? ''
|
const name = radioButtonGroup?.name ?? _name ?? ''
|
||||||
const selected = radioButtonGroup
|
const selected = radioButtonGroup
|
||||||
? radioButtonGroup.value === value
|
? radioButtonGroup.value === value
|
||||||
: _checked
|
: _checked
|
||||||
|
|
Loading…
Reference in New Issue