Grokking React Native
Vote

0% completed

​

Implementing Pagination & Infinite Scrolling

How does an app show 100 posts when it asks the server for only 10 at a time? FlatList avoids rendering every row, but it still needs the whole array, and downloading a long list at once wastes time and mobile data. The server therefore returns the data in pieces called pages, and the app asks for the next page when it needs more.

The running example uses the practice server from the Data Fetching chapter, which holds 100 posts and accepts a page number and a page size:

GET https://jsonplaceholder.typicode.com/posts?_limit=10&_page=1 posts 1 to 10 GET https://jsonplaceholder

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content