react-native-simple-radio-button icon indicating copy to clipboard operation
react-native-simple-radio-button copied to clipboard

Not working with hooks React Native 0.61

Open minayaleon opened this issue 5 years ago • 2 comments

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

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

minayaleon avatar Nov 08 '19 01:11 minayaleon

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

blairharper avatar Feb 12 '20 17:02 blairharper

thanks this solution worked for me as well.

NightCoderPal avatar Sep 05 '21 16:09 NightCoderPal