title: React : setState in componentDidMount not causing infinite loop
body: <p>I am new to ReactJS. When i am reading ReactJS Blueprint book author had specified that </p>
  
  <blockquote>
    <p>"but take care to never run setState in here, as that will trigger an
    endless update loop."</p>
  </blockquote>
  
  <p>So, i have created a below simple component but i did not see any such infinite loop happening.</p>
  
  <pre><code>'use strict';
  import React from 'react';
  import { render } from 'react-dom';
  const App = React.createClass({
      displayName : "SG",
      getDefaultProps() {
          return {
              age : "24"
          }
      },
      getInitialState() {
          return {
              date : ""
          }
      },
      componentDidMount() {
          debugger;
          var d = new Date();
          this.setState({date: d.getMilliseconds().toString()});
      },
      render() {
          return (
              &lt;section&gt;
                  &lt;h1&gt;Demo App&lt;/h1&gt;
                  &lt;p&gt;Name : {this.props.name}&lt;/p&gt;
                  &lt;p&gt;Age : {this.props.age}&lt;/p&gt;
                  &lt;p&gt;date : {this.state.date}&lt;/p&gt;
              &lt;/section&gt;
          );
      }
  });
  render (&lt;App name='Gowtham S'/&gt;, document.getElementById('container'));
  </code></pre>
  
  <p>I kept debugger in componentDidMount but it is hitting only once. Whats wrong with my code can anyone help me?</p>
  
  <p>Thanks</p>