ReactJS radio button

This entry is part 3 of 35 in the series React JS

http://jsbin.com/mozegodapa/edit?html,js,console,output

class App extends React.Component {

  setFruit(event) {
    console.log(event.target.value);
  }

  render() {
    return (
      <div onChange={this.setFruit.bind(this)}>
        <input type="radio" value="Apple" name="fruit"/> Apple
        <input type="radio" value="Orange" name="fruit"/> Orange
      </div>
     )
  }
}

ReactDOM.render(<App/>, document.getElementById('app'));
Series Navigation<< React From The Ground Up by Tim Knight
ReactJS: Input Text Field >>