reactjs - Correct way of using useState hook on radio buttons - Stack Overflow

PHOTO EMBED

Sun Jul 24 2022 17:53:28 GMT+0000 (UTC)

Saved by @Ddev #javascript #react.js

<Form.Field control={Radio} label="Male" checked={gender === 'Male'} value="Male" onClick={() => setGender('Male')} />
<Form.Field control={Radio} label="Female" checked={gender === 'Female'} value="Female" onClick={() => setGender('Female')} />
content_copyCOPY

form radio buttons

https://stackoverflow.com/questions/58094441/correct-way-of-using-usestate-hook-on-radio-buttons