moschan / react-native-simple-radio-button

Simple and handy animated radio button component for React Native
MIT License
453 stars 130 forks source link

Not working with hooks React Native 0.61 #132

Open minayaleon opened 5 years ago

minayaleon commented 5 years ago

onPress not select the radio when it use useState (hooks)

const [option, setOption] = useState(0); onPress={value => { setOption(value); }}

blairharper commented 4 years ago

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); }}

NightCoderPal commented 3 years ago

thanks this solution worked for me as well.