title: React Hooks: handle multiple inputs
body: <p>on <a href="https://reactjs.org/docs/forms.html" rel="noreferrer">react docs forms section</a> there is the following example using class components:</p>
  <pre><code>class Reservation extends React.Component {
    constructor(props) {
      super(props);
      this.state = {
        isGoing: true,
        numberOfGuests: 2
      };
  
      this.handleInputChange = this.handleInputChange.bind(this);
    }
  
    handleInputChange(event) {
      const target = event.target;
      const value = target.type === 'checkbox' ? target.checked : target.value;
      const name = target.name;
  
      this.setState({
        [name]: value
      });
    }
  
    render() {
      return (
        &lt;form&gt;
          &lt;label&gt;
            Is going:
            &lt;input
              name=&quot;isGoing&quot;
              type=&quot;checkbox&quot;
              checked={this.state.isGoing}
              onChange={this.handleInputChange} /&gt;
          &lt;/label&gt;
          &lt;br /&gt;
          &lt;label&gt;
            Number of guests:
            &lt;input
              name=&quot;numberOfGuests&quot;
              type=&quot;number&quot;
              value={this.state.numberOfGuests}
              onChange={this.handleInputChange} /&gt;
          &lt;/label&gt;
        &lt;/form&gt;
      );
    }
  }
  </code></pre>
  <p>Considering Hooks can only be called either in a React function component or a custom React Hook function is there a way of doing it using hooks instead?</p>