title: How to add pagination in ReactTable with API call on click of next button
body: <p>I want to add pagination with previous and next buttons in ReactTable where I am displaying 10 rows by default. I am not sure if there are more than 10 rows in the Database.</p>
  <p>I want to first display the first 10 rows and on click of the next button, API should be called which will fetch the other 10 rows, if there.</p>
  <p>Here's the ReactTable:</p>
  <pre><code>&lt; ReactTable
  columns = {
    [{
        Header: &quot;Id&quot;,
        accessor: &quot;id&quot;
      },
      {
        Header: &quot;Name&quot;,
        id: &quot;name&quot;
      }
    ]
  }
  manual
  data = {
    data
  }
  pages = {
    pages
  } &lt; -- -- -- -- - I don 't know the total number of pages
  loading = {
    loading
  }
  onFetchData = {
    () =&gt; this.fetchData()
  }
  /&gt;
  </code></pre>
  <p>Here the problem is that I don't know the <strong>Total number of rows</strong> present in DB so that I can pass it to pages. How can I do that without knowing the total number of pages, and just simply clicking on the Next button if there are any rows, will be displayed.</p>