Pagination

We used built-in components from Reactstrap to implement pagination. On the front-end side, we calculated and displayed the correct number of pagination tabs using the number of items we have to display and the number of items we wanted to show per page (12 items).

Our API handles requests for a specific page of results. Simply append page={page} to the API request to get a certain page of results. For instance, sending an API request with api.tacoboutaustin.me/restaurants?page=4 will get the 4th page of results for restaurants.

Every time a user clicks on a pagination tab, we make an API request to fetch that specific page.

Also, the page parameter in the API request can work in conjunction with sorting and filtering. So to get a certain page of sorted and filtered results, build the API request for getting those results and just append page={page}.

results matching ""

    No results matching ""