I am new to ReactJS, sorry if this sounds off. I have a component that creates several table rows according to the received data.
Each cell within the column has a
Here is a simplest way of implementing radio buttons in react js.
class App extends React.Component {
setGender(event) {
console.log(event.target.value);
}
render() {
return (
Male
Female
)
}
}
ReactDOM.render( , document.getElementById('app'));
Edited
You can use arrow function instead of binding. Replace the above code as
For a default value use defaultChecked
, like this Male