Grokking React Native
Vote

0% completed

​

Load More, Numbered Pages, and useInfiniteQuery

Infinite scrolling decides for the user when the next page loads. Not every list should work that way. The previous lesson built this design in a component called PostList. It used the practice server, which holds 100 posts and returns them 10 at a time. Page 10 ends at post 100. Page 11 comes back as an empty array, which is how this API reports that nothing is left.

Two other designs send the same requests: a button that loads more, and numbered pages that replace each other. This lesson builds both. It then replaces the hand-written state of PostList with the `useInfiniteQuery

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content