title: Calling state in react
body: <p>I have one function which gets a value and after setting state calls another function, however, after I try to log that state into the console in the second function (generatePdf), it doesn't log anything, as if the state wasn't updated. Does anyone know where is the problem?</p>
  <pre><code>pickMonth=(value)=&gt;{
    this.setState({ m: value }, ()=&gt;console.log(this.state.m), this.generatePdf())
  }
  
  generatePdf(){
    const {m} = this.state
   console.log(m);
  </code></pre>
  <p>Thanks in advance!</p>