title: Axios.get() ReactJS
body: <p>I'm making simple To-Do App in ReactJS.For now I'm adding Routes I managed to implement <code>.post</code> method,but now I'm stuck on <code>.get</code> Method,it's being looped and is rendering over and over again.
  Here is what am I doing.</p>
  
  <pre><code>state = {
      inputValue: '',
      todos: [],
      currentPage: 1,
      pageCount: 1,
      itemsPerPage: 10,
  };
  
  getAll = () =&gt; {
      let {todos} = this.state
      axios
          .get("http://localhost:8080/", {
              todos:todos
          })
          .then((res) =&gt; {
              this.setState({todos:res.data})
          })
          .catch((err) =&gt; {
              console.log("err", err);
          });
  };
  
  render() {
      const {itemsPerPage, currentPage, todos} = this.state;
      const end = currentPage * itemsPerPage
      const start = end - itemsPerPage 
      const currentItems = todos.slice(start, end);
      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} name={''} type='text'/&gt;
          &lt;button onClick={() =&gt; this.addItem()} className={'btn btn-primary'}&gt;Add&lt;/button&gt;
          &lt;ul&gt;
  
              {
                  todos.length ?
                  currentItems.map(todoItem =&gt; &lt;ListItem
                      key={todoItem.id}
                      todoItem={todoItem}
                      deleteItem={this.deleteItem}
                      editItem={this.editItem}
                      submitEdit={this.submitEdit}
                      getAll = {this.getAll}
                  /&gt;) :
                      null
              }
              &lt;div&gt;
                   {this.getAll()}
                  {this.renderPagination()}
              &lt;/div&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  };
  }
  
  export default App;
  </code></pre>
  
  <p>All I want to do is to Render received data into <code>&lt;ul&gt;</code> and make it appear as <code>li</code>,But the problem is it is stuck in infinite loop and is updating page over and over again.
  Any suggestions?</p>