-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering React Test-Driven Development
By :

By default, our endpoint returns 10 records. To get the next 10 records, we can page through the result set by using the after
parameter, which represents the last customer identifier seen. The server will skip through results until it finds that ID and returns results from the next customer onward.
We’ll add Next and Previous buttons that will help us move between search results. Clicking Next will take the ID of the last customer record currently shown on the page and send it as the after
parameter to the next search request.
To support Previous, we’ll need to maintain a stack of after
IDs that we can pop each time the user clicks Previous.
Let’s start with the Next button, which the user can click to bring them to the next page of results. Since we’re going to be dealing with multiple buttons on the screens, we’ll build a new buttonWithLabel
helper that will match...