Step 1:
Create three states:
- Contain an array of tokens.
- Contain the current Page number
- A state maintaining our fetched data
Step 2:
Initiate the function to retrieve data from the graphql sever passing your tokens, here we use the useEffect and useCallback hook to manage the call function:
Step 3:
Create the next and previous buttons. Add the onClick event handler; this takes care of incrementing the page number or decrementing it.
Top comments (0)