title: How to do increment in map function in react js
body: <pre><code>`{Array.apply(null, {length:this.state.length}).map((value, i) =&gt; ( 
  &lt;div&gt;
  &lt;div&gt;{i}&lt;/div&gt;
  &lt;div&gt;{i+1}&lt;/div&gt;
  &lt;div&gt;{i+2}&lt;/div&gt;
  &lt;/div&gt;)}
  &lt;button onClick={()=&gt;this.loadmore(event)}&gt;Load More&lt;/button&gt;`
  </code></pre>
  
  <p>Below is the load more code</p>
  
  <pre><code>public loadmore(e)
  {
    e.preventDefault()
    this.setState(prevState =&gt; ({length:prevState.length+1}))
  }
  </code></pre>
  
  <p>I want to display 
  012 (when i click load more 456 should appear)
  345
  678</p>
  
  <p>Instead I'm getting 
  012
  123
  234</p>
  
  <p>Is there any way to increment the value of i after i+2</p>