title: Howto add pagination with axios get request in Reactjs
body: <p>I am receiving 50 data with get request using axios, and I want to add pagination to my code on every page i want 5 results, how to implement pagination with axios response.</p>
  
  <pre><code>    import React from 'react';
      import axios from 'axios';
  
      export default class PersonList extends React.Component {
        state = {
          persons: []
        }
  
        componentDidMount() {
          axios.get(`https://jsonplaceholder.typicode.com/Todos`)
            .then(res =&gt; {
              const persons = res.data;
              this.setState({ persons });
            })
        }
  
        render() {
          return (
           &lt;div&gt;
            &lt;ul&gt;
              { this.state.persons.map(person =&gt; &lt;li&gt;{person.name}&lt;/li&gt;)}
            &lt;/ul&gt;
                     &lt;button onClick={this.previousPage}&gt;PreviousPage&lt;/button&gt;
                     &lt;button onClick={this.nextPage}&gt;Next Page&lt;/button&gt;
          &lt;/div&gt;
          )
        }
      }
  </code></pre>