title: Updating state within setTimeout (React & React-Native)
body: <p>What I've been trying to achieve are to update <code>state</code> and to update the same state again, based on Javascript's timer.</p>
  
  <p>The reason why I can't achieve this seems to be the nature of <code>state</code> in React.js.</p>
  
  <p>Here is a snippet of my experimentation...</p>
  
  <pre><code>render() {
      if (this.props.hasError) {
          setTimeout(function(){this.setState({showWarning: true}); }.bind(this), 3000);
      }
      return (
        &lt;View&gt;
          &lt;Blah warning={this.state.showWarning} /&gt;
        &lt;/View&gt;
      );
  }
  </code></pre>
  
  <p>So, the objective is to change state for <code>only just a few seconds if there is a specific props provided</code>.</p>
  
  <p>This approach seems to hit the limit of updating states, if <code>this.props.hasError</code> gets updated too frequently.</p>
  
  <p>Apologies if this question is too basic.
  Any suggestion will be appreciated.</p>