title: Single onChange function for multiple input fields is not working: ReactJS
body: <p><strong>Code:</strong></p>
  
  <pre><code>import React, { Component } from 'react';
  import { Button, Input, Row, Col, Label } from 'reactstrap';
  
  export default class  Settings extends Component {
  
      constructor(props) {
          super(props);
          this.state = { 
              tallyPort: '', companyYear: '', interval: '', timeRange: '', 
              databasePort: '', databaseUserName: '', databasePassword: '' 
          };  
      }
  
      handleChange = (stateName, e) =&gt; {
          this.setState({ stateName: e.target.value });
      }
  
      handleSave = () =&gt; {
          console.log(this.state)
      }
  
      render() {
          return(
              &lt;div className="dashboard" &gt;
                  &lt;Input name="tallyPort" onChange={this.handleChange.bind(this, 'tallyPort')}  /&gt;
                  &lt;Input name="companyYear" onChange={this.handleChange.bind(this, 'companyYear')} /&gt;
                  &lt;Input name="interval" onChange={this.handleChange.bind(this, 'companyYear')} /&gt;
                  &lt;Input name="timeRange" onChange={this.handleChange.bind(this, 'companyYear')} /&gt;
                  &lt;Input name="databasePort" onChange={this.handleChange.bind(this, 'companyYear')} /&gt;
                  &lt;Input name="databaseUserName" onChange={this.handleChange.bind(this, 'companyYear')} /&gt;
                  &lt;Input name="databasePassword" onChange={this.handleChange.bind(this, 'companyYear')} /&gt;
  
                  &lt;Button style={{ width: '200px', marginLeft: '720px'}} onClick={this.handleSave.bind(this)} color="primary"&gt;Save&lt;/Button&gt;
              &lt;/div&gt;
          );
      }
  }
  </code></pre>
  
  <p>Main problem with <code>this.setState</code> function, I'm not understand why it is not working.
  I'm trying to set each state value on <code>"onChange"</code> of input field, <code>"setState"</code> is not working properly, when i'm console all states after given values, it returns blank values, any one help me?</p>