1 handleInputChange(event) {
2 const target = event.target;
3 const value = target.name === 'isGoing' ? target.checked : target.value;
4 const name = target.name;
5 this.setState({
6 [name]: value
7 });
8 }
9
10 <input
11 name="isGoing"
12 type="checkbox"
13 checked={this.state.isGoing}
14 onChange={this.handleInputChange} />