title: setState vs replaceState in React.js
body: <p>I am new to React.js Library and I was going over some of the tutorials and I came across:</p>
  
  <ul>
  <li><code>this.setState</code></li>
  <li><code>this.replaceState</code></li>
  </ul>
  
  <p>The Description given is not very clear (IMO).</p>
  
  <pre><code>setState is done to 'set' the state of a value, even if its already set 
  in the 'getInitialState' function.
  </code></pre>
  
  <p>Similarly,</p>
  
  <pre><code>The replaceState() method is for when you want to clear out the values 
  already in state, and add new ones.
  </code></pre>
  
  <p>I tried <strong><code>this.setState({data: someArray});</code></strong> followed by <strong><code>this.replaceState({test: someArray});</code></strong> and then console.logged them and I found that <code>state</code> now had both <code>data</code> and <code>test</code>.</p>
  
  <p>Then, I tried <strong><code>this.setState({data: someArray});</code></strong> followed by <strong><code>this.setState({test: someArray});</code></strong> and then console.logged them and I found that <code>state</code> again had both <code>data</code> and <code>test</code>.</p>
  
  <p>So, what exactly is the difference between the two ?</p>