react-native-simple-radio-button
react-native-simple-radio-button copied to clipboard
Not working with hooks React Native 0.61
onPress not select the radio when it use useState (hooks)
const [option, setOption] = useState(0);
onPress={value => { setOption(value); }}
Your onPress has no return, remove one set of curly brackets to add an implicit return:
onPress={value => setOption(value)}
Or explicitly return:
onPress={value => { return setOption(value); }}
thanks this solution worked for me as well.