I\'m making a form, and I was in need of a radio input. How do I get the checked radio input in a onSubmit-function, what is the correct way?
This is my code, I myRadioI
i use this solution for radio button two way binding with active :
inside render() method:
const items = [ {label: 'one', checked: false}, {label: 'two', checked: true}, {label: 'three', checked: true} ]; items.map((item, index) => ( {item.label} { $('.radioItem').filter('.active').removeClass('active'); $(e.currentTarget).closest('.radioItem').addClass('active'); }} ref={elm => $(elm).prop('checked', item.checked)} /> ))