title: pagination in react native
body: <p>I am implementing pagination in react native app my Web API is giving total record size and option to send page no as a parameter. 
  www.URL.com/api/GetAll?pageNo={pageNumber}. Currently I'm using the standard approach i.e: </p>
  
  <pre><code> let pageNumbers = TotalRecords/PageSize;
         for(i=0; i&lt;pageNumbers; i++)
         {
               pageNumberArray[i] = i + 1;
         }
  this.setstate({pageNumber: pageNumberArray})
  
  
  
  
  render()
  {
  this.state.data.map(function (data, index)
          {
  &lt;Card&gt;
  &lt;CardItem&gt;
  &lt;Text&gt;SHOWING DATA HERE {data.Title}&lt;/Text&gt;
  &lt;/CardItem&gt;
  &lt;/Card&gt;
  }
  {/*SHOWING PAGE NUMBERS*/}
      {this.state.totalRecrods &gt; 1 &amp;&amp; 
      &lt;View&gt;
   &lt;FlatList
   height={50}
   style={{padding:10}}
      data={ this.state.pageNumber }
      renderItem={({item}) =&gt; &lt;Text style={{backgroundColor:'rgb(191, 219,215)', margin:5,height:50}}&gt;{item}&lt;/Text&gt;}
     keyExtractor={(item, index) =&gt; index}
     horizontal={true}
  /&gt;
  &lt;/View&gt;
  
      }
  }
  </code></pre>
  
  <p>Now I have standard page numbers and on click on every page number I called the URL again with respective page number and update the data state that shows next 50 records.</p>
  
  <p>The issue is I don’t like this traditional approach in mobile app. I want to implement the Card View such that on scroll it automatically loads another 50 records. Not showing page numbers to the user and saving all time clicking on page number to go to next page.</p>