title: Creating button with Loop ReactJS
body: <p>I'm new to the react and I'm making simple To-Do app application,I already implemented Add,Delete,Edit and now I'm working on Pagination.
  The problem is I'm trying to create Loop which will create several Buttons for Pagination,For example:If there is 5 list items There shall be 1 button,if there is 10 list items then there shall be 2...etc...</p>
  
  <p>I tried to do: </p>
  
  <pre><code>state = {
          inputValue: '',
          todos: [],
          currentPage:1,
          pageCount:1,
      };
  
      inpRef = createRef();
  
      setPageCount = () =&gt; {
              let {todos} = this.state
            this.setState({pageCount: Math.ceil(todos.length / 5)})
              console.log('--------this.state.pageCount', this.state.pageCount );
      }
  
  paginationDisplay = () =&gt; {
          console.log('helo')
      }
  
          renderPagination = () =&gt; {
              let {pageCount,currentPage} = this.state
              for (let i= 1;i&lt;pageCount; i++){
                  &lt;button onClick={() =&gt; {
                  this.paginationDisplay()
                  currentPage = i}
                  }&gt;
                      {pageCount}
                  &lt;/button&gt;
              }
  
  
  
          }
  
              render() {
              const { todos } = this.state;
  
              return &lt;div className={"App"}&gt;
                  &lt;div className="App-header"&gt;
                      &lt;h2&gt;Welcome to To-Do List App&lt;/h2&gt;
                  &lt;/div&gt;
                  &lt;input ref={this.inpRef} onKeyPress={this.handleKeyPress} onChange={this.handleInputValue} name={''} type='text'/&gt;
                  &lt;button onClick={() =&gt; this.addItem()} className={'btn btn-primary'}&gt;Add&lt;/button&gt;
                  &lt;ul&gt;
                      {
                          todos.map(todoItem =&gt; &lt;ListItem
                              key={todoItem.id}
                              todoItem={todoItem}
                              deleteItem={this.deleteItem}
                              editItem={this.editItem}
                              submitEdit={this.submitEdit}
                          /&gt;)
                      }
                      {this.renderPagination()}
                  &lt;/ul&gt;
              &lt;/div&gt;
          };
      }
  </code></pre>
  
  <p>It's not working and I don't know how fix my Loop.Please help</p>