title: setState does not set the state properly, when dropdown values changes
body: <p>I am having this scenario, where I have a dropdown which pulls the accounts of a user and then based on its selection the content of the page changes. I am trying an approach which is shown below , It seems like setState does not get invoked properly or may be calling sequence may be wrong. Not really getting what is wrong. Changing drop down value does not update the content .</p>
  
  <p>Help would be appreciated.</p>
  
  <pre><code>import * as React from 'react';
  import Select from 'semantic-ui-react/dist/commonjs/addons/Select';
  
  interface IState{
    accountDetails[], // stores all details w.r.t an account
    userAccounts: [], // stores all accounts w.r.t a user
    selectedAccount : string, // selected account from the dropdown
    [x: string] : any,
  }
  
  export default class App extends React.Component&lt;{},IState&gt; {
  
    constructor(props:any){
      super(props);
      this.state = {
        accountDetails: [],
        userAccounts: [],
        selectedAccount: ''
      }
    }
  
    dropdownChange = (event: React.SyntheticEvent&lt;HTMLElement&gt;, data:any) =&gt; {
       this.setState(prevState =&gt; ({
        selectedAccount: data.value
       }), () =&gt; {});
    }
  
    async componentDidMount()
    {
        await this.fetchUserAccounts();
    }  
  
  
    fetchUserAccounts = async() =&gt; {
      //fetch API call for getting all user accounts by passing a user ID
      // I am able to get the data
      fetch('/api/fetch/accounts'
        .then(response =&gt; response.json())
        .then(data =&gt; this.setState({ userAccounts: data}));
      this.fetchAccountDetails();
    }    
  
    fetchAccountDetails = async() =&gt;
    {
         let URL = "/api/fetch/account?accountId=" +this.state.selectedAccount;
         fetch('URL'
          .then(response =&gt; response.json())
          .then(data =&gt; this.setState({ accountDetails: data}));
    }
  
    render() {
      return(
         &lt;div&gt;
           &lt;Select 
                   options={this.state.userAccounts} 
                   name="selectedAccount"  
                   value={this.state.selectedAccount}
                   onChange={this.dropdownChange}                         
          /&gt;
          // component to display the details
          &lt;DetailComponent accounts={this.state.accountDetails} /&gt;
        &lt;/div&gt;
      )
    }
  }
  </code></pre>