title: How to change closeMenuOnSelect value on event in react-select?
body: <p>I am trying to close the <code>Select</code> dropdown when the limit of selected items is reached.</p>
  <p>The following is not working:</p>
  <pre><code>handleSearch = selectedOption =&gt; {
      const closeMenuOnSelect = selectedOption.length &gt;= 3;
      this.setState({ closeMenuOnSelect }, () =&gt; this.updateSelect());
  }
  
  updateSelect = () =&gt; {
      console.log(this.state.closeMenuOnSelect); // the state is getting updated but it does not have the effect on the `closeMenuOnSelect` property
  }
  </code></pre>
  <p>And the component:</p>
  <pre><code>&lt;Select className='react-select-container'
                              isMulti
                              closeMenuOnSelect={this.state.closeMenuOnSelect}
                              options={this.state.locations}
                              onChange={(e) =&gt; this.handleSearch(e)} /&gt;
  </code></pre>
  <p>It doesn't need to on event. I just want the menu to remain open and when the limit of selected options is reached I want to close it.</p>