title: Why does window.location not work in my react component?
body: <p>stackoverflower:
  I met a quite strange problem, here is my sample code:</p>
  
  <pre><code>export default class MyAwesomeComponent extends React.Component{
      constructor(props){
          super(props)
          this.handleClick = this.handleClick.bind(this)
      }
  
      handleClick(){
          //do some expression
          window.location = 'url I want to jump'
      }
  
      render(){
        return &lt;button onClick={this.handleClick}/&gt; 
     }
  }
  </code></pre>
  
  <p>but when invoked <code>handleClick</code>, my spa will not jump to the url which, instead, it did nothing. The problem be solved when replace with following code :</p>
  
  <pre><code> handleClick(){
     setTimeout(()=&gt;{window.location = 'url I want to jump'}) 
  }
  </code></pre>
  
  <p>It seems I met js single thread problem, and <code>setTimeout</code> or <code>nextTick</code> can solve the problem</p>
  
  <p>can you explain this?</p>
  
  <p>by the way, the running environment is under a customized MVC with react-like， redux-like package. maybe is the MVC inner black magic rather than single thread caused my trouble</p>
  
  <p>thx </p>