diff --git a/packages/components/src/radio-group/index.js b/packages/components/src/radio-group/index.js index 2c024d6c1ce00..517af1c0dcba6 100644 --- a/packages/components/src/radio-group/index.js +++ b/packages/components/src/radio-group/index.js @@ -26,8 +26,8 @@ function RadioGroup( ...radioState, disabled, // controlled or uncontrolled - state: checked || radioState.state, - setState: onChange || radioState.setState, + state: checked ?? radioState.state, + setState: onChange ?? radioState.setState, }; return ( diff --git a/packages/components/src/radio-group/stories/index.js b/packages/components/src/radio-group/stories/index.js index 88dd726005ad6..57804933797f0 100644 --- a/packages/components/src/radio-group/stories/index.js +++ b/packages/components/src/radio-group/stories/index.js @@ -47,7 +47,7 @@ export const disabled = () => { }; const ControlledRadioGroupWithState = () => { - const [ checked, setChecked ] = useState( 'option2' ); + const [ checked, setChecked ] = useState( 1 ); /* eslint-disable no-restricted-syntax */ return ( @@ -58,9 +58,9 @@ const ControlledRadioGroupWithState = () => { checked={ checked } onChange={ setChecked } > - Option 1 - Option 2 - Option 3 + Option 1 + Option 2 + Option 3 ); /* eslint-enable no-restricted-syntax */