Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhenjaHorbach committed Feb 27, 2024
1 parent 87f2848 commit 8cf4670
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/RadioButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ type RadioButtonsProps = {
function RadioButtons({items, onPress, defaultCheckedValue = '', radioButtonStyle, errorText, onInputChange = () => {}, value}: RadioButtonsProps, ref: ForwardedRef<View>) {
const styles = useThemeStyles();
const [checkedValue, setCheckedValue] = useState(defaultCheckedValue);

useEffect(() => {
if (value === checkedValue || value === undefined) {
return;
}
setCheckedValue(value);
setCheckedValue(value ?? '');
}, [checkedValue, value]);

return (
Expand Down

0 comments on commit 8cf4670

Please sign in to comment.