title: Passing state variables from Child To Parent using React
body: <p>I feel like there is an easier way to do all this. I am trying to pass all of the <code>state</code> variables from <code>Child</code> to <code>Parent</code> after the user has clicked the <code>Submit button</code>. Could somebody please point out what I am doing wrong?</p>
  
  <p><strong>AddSeanceForm.js</strong> (Child)</p>
  
  <pre><code>class AddSeanceForm extends React.Component{
      constructor(...args) {
         super(...args);
          this.state = {
             devices: "",
             interval: ""
          };
         this.handleChange = this.handleChange.bind(this);
         this.onSelect = this.onSelect.bind(this);
      }
  
      render() {
          return (
              ...
              &lt;form onSubmit={(event, devices, interval) =&gt; this.props.handleSubmit(event, this.state.devices, this.state.interval)}&gt;
              ...)
  </code></pre>
  
  <p><strong>SeanceManager.js</strong> (Parent)</p>
  
  <pre><code>handleSubmit = (event, devices, interval) =&gt; {
      event.preventDefault();
      console.log(devices, interval)
      ...
  };
  </code></pre>
  
  <p>This solution works, but I am planning to make more variables and this does not seem optimal. </p>