Answers for "typescript checkbox event"

0

typescript checkbox event

handleInputChange(event) {
        const target = event.target;
        const value = target.name === 'isGoing' ? target.checked : target.value;
        const name = target.name;
        this.setState({
          [name]: value
        });
      }

    <input
       name="isGoing"
       type="checkbox"
       checked={this.state.isGoing}
       onChange={this.handleInputChange} />
Posted by: Guest on April-27-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language