title: React - how to pass multiple input values to child in on change event when values have different types (is not always e.target.value)?
body: <p>I have multiple input fields and 1 react-select dropdown field. I created a method in my parent component that sets the state with the values from the input, passes it down to the child which should call the method. My problem is that react-select doesn't take the value but an object like this:</p>
  
  <pre><code>{value: 'xy', name:'x', label: 'y'}
  </code></pre>
  
  <p>so normally my function in my onChange event handler would look like this (when passing multiple values):</p>
  
  <p>in parent:</p>
  
  <pre><code>testing(e) {
      this.setState({
          [e.target.name]: e.target.value
      })
  }
  </code></pre>
  
  <p>in child:</p>
  
  <pre><code>&lt;input type="text" name="maxfare" onChange={this.onChange}/&gt;
  ...
  onChange(e){
     var value = [e.target.name] = e.target.value;
     this.props.onChange(value);
  }
  ...
  </code></pre>
  
  <p>However, while my input fields take:</p>
  
  <pre><code>e.target.value
  </code></pre>
  
  <p>my select dropdown takes entire 'e' - not e.target.value. I tried to pass my onChange function in child component 2 arguments, calling my method in parent with 2, but that doesn't to work. Any help would be great! My code is below (the relevant parts- if I forgot something that you think is important, please let me know). Ps. I thought about having 2 onChange functions, passing once my value for select dropdown and a second one doing the rest, but then I would need to pass 2 onChange methods to the child and I believe thats not possible in react?! Thanks!!:</p>
  
  <p>Parent:</p>
  
  <pre><code>...
   onChangeT(selectValue, value) {
      this.setState({
          origin: selectValue,
          maxfare: value
          ...       
      })
  }
  render(){
  ....
    &lt;Parent cities={this.state.citiesToSelect} origin={this.state.origin} maxfare={this.state.maxfare} onChange={this.onChangeT}/&gt;
  ...
  }
  </code></pre>
  
  <p>Child:</p>
  
  <pre><code>....
  onChangeC(e){
      var value = [e.target.name] = e.target.value;
      this.props.onChange(e, value);
      console.log("name",  name)
  }
  ....
  &lt;Select
       onChange={this.onChangeC}
       labelKey='name'
       value={this.props.origin}
       options={this.props.cities}                 
  /&gt;
  &lt;input type="text" name="maxfare" onChange={this.onChangeC}/&gt;
  </code></pre>