title: When value is assigned to components state, why console.log prints the previous state?
body: <p>I'm sending values of numbers from Numbers component to Main component. Everything is working fine until I set that value in my Main component to that  component's state.</p>
  
  <pre><code>var Numbers = React.createClass({
      handleClick: function(number){
          this.props.num(number)
      },
      render: function(){
          return (
              &lt;div&gt;
                  &lt;button onClick={this.handleClick.bind(null, 1)}&gt;1&lt;/button&gt;
                  &lt;button onClick={this.handleClick.bind(null, 2)}&gt;2&lt;/button&gt;
                  &lt;button onClick={this.handleClick.bind(null, 3)}&gt;3&lt;/button&gt;
              &lt;/div&gt;
          )
      }
  })
  
  var Main = React.createClass({
      getInitialState: function(){
          return {
              number: 0
          }
      },
      handleCallback: function(num){
          console.log("number is right here: " + num);
          this.setState({
              number: num
          })
          console.log("but wrong here (previous number): " + this.state.number)
      },
      render: function() {
          return (
              &lt;Numbers num={this.handleCallback} /&gt;
              //&lt;SomeComponent number={this.state.number} /&gt;
          )
      }
  });
  
  React.render(&lt;Main /&gt;, document.getElementById('container'));
  </code></pre>
  
  <p>Why is it behaving like this? Second <code>console.log</code> in <code>handleCallback</code> function prints the previous number, not the number which is in <code>num</code> parameter. I need right number to be in my state, because I'm going to send it immediately as an props in my <code>SomeComponent</code> component.</p>
  
  <p><a href="https://jsfiddle.net/69z2wepo/13000/" rel="noreferrer">https://jsfiddle.net/69z2wepo/13000/</a></p>