title: React is not re rendering after setState is called, why?
body: <pre><code>
  export default class Data extends Component {
    constructor(props)
    {
      super(props);
      this.state = {
        pages : [],
      }
      this.handleClick = this.handleClick.bind(this);
    }
    
    handleClick(event){
  
      
     var newpages = this.state.pages;
     
      newpages.push(event);
      this.setState = ({
        pages: newpages,
      });
      console.log(this.state.pages)
      if(this.state.pages!=undefined)
      {this.state.pages.forEach(element =&gt; 
                              ((element!=undefined) ?console.log(&quot;jsjha&quot;):console.log(&quot;hsdgahdhasgh&quot;) ))}
  //working  
      
    }
  
    
  
    render() {
      console.log(this.state.pages); // not working, nothing is printed in the console
      return (
        &lt;&gt;
      
      &lt;button onClick={()=&gt;this.handleClick(&quot;Tab 1&quot;)} value=&quot;Tab 1&quot; id=&quot;1&quot;&gt;Tab 1&lt;/button&gt;
      &lt;button onClick={()=&gt;this.handleClick(&quot;Tab 2&quot;)} value=&quot;Tab 2&quot; id=&quot;2&quot;&gt;Tab 2&lt;/button&gt;
      &lt;button onClick={()=&gt;this.handleClick(&quot;Tab 3&quot;)} value=&quot;Tab 3&quot; id=&quot;3&quot;&gt;Tab 3&lt;/button&gt;
      &lt;h3&gt;Hello this is Data bar!&lt;/h3&gt;
      &lt;hr/&gt;
      
      { 
        (this.state.pages.map(function(element,i)
          {return &lt;p key={i}&gt;{element}hdkashdak&lt;/p&gt; }))
      }
  // not working
                              
                     
      
      
      &lt;/&gt;
      );
    }
  }
  </code></pre>
  <p>In the console.log , I can see &quot;jsjha&quot; being printed, means the state is bein updated.
  But in the render function I cannot see the set being updated.</p>
  <p>I have even bind the handleClick function.</p>
  <p>Also, is everything correct witht the JSX map function? I am using the return statement and still it isn't working.</p>