title: react setState callback doesn't have the updated state
body: <p>if <code>monthOffset = 12</code> the condition will evaluate to true and update the <code>yearOffset</code> state to 2017 if <code>yearOffset = 2018</code>. Based on the react docs and other answers I've read, the callback function in <code>this.setState</code> fires after the state has been updated, yet the <code>console.log()</code> is still outputting 2018. I've tried a couple different methods of implementing this code based on answers form other related questions but mine isn't working. I'm not sure why.</p>
  
  <pre><code>handleClick(e) {
    const { monthOffset, yearOffset } = this.state
    this.setState({ monthOffset: monthOffset - 1 })
    if ( monthOffset - 1 === 11 ) { this.setState((prevState) =&gt; { 
      return { yearOffset: prevState.yearOffset - 1 } },
      () =&gt; {console.log("yearOffset", yearOffset)}
    )}
    console.log("clicked")
  }
  </code></pre>