title: I am setting a property using setState before dispatching an action, but the property is not set in the redux action on dispatch
body: <p>I have a class component as follows,</p>
  
  <pre><code>  class PassengerAddPage extends React.Component {
    state = {
      passenger: {
        flightNumber: "",
        firstName: "",
        lastName: "",
        address: "",
        dob: "",
        passportNumber: ""
      }
    };
  </code></pre>
  
  <p>I will populate all the fields from form data that user enters, except flightNumber, which will be taken from url param, "this.props.match.params.flightNumber". The handleSubmit for the form is as follows,</p>
  
  <pre><code>handleSubmit = event =&gt; {
      event.preventDefault();
      console.log(this.props.match.params.flightNumber); //prints AH001
      this.setState(
        {
          ...this.state,
          flightNumber: this.props.match.params.flightNumber
        },
        () =&gt; console.log(this.state.passenger) //prints empty
      ); 
      this.props.dispatch(passengerActions.addPassenger(this.state.passenger));
  }
  </code></pre>
  
  <p>Even though I set the flightNumber, it will still show as empty in the Redux store (After dispatching the action, object recieved in the action will contain empty value for flightNumber property).</p>
  
  <p>Please help. I am new to ReactJS and JS.</p>