title: React setState and then check for the value
body: <p>What's the problem on this function? Why I can't check for a variable state after set a value?</p>
  <pre class="lang-js prettyprint-override"><code>const updateHandler = () =&gt; {
    this.setState({ logged: true })
    if (this.state.logged) {
      this.setState({ showDialog: true })
    }
  }
  </code></pre>