React Pagination Antd

PHOTO EMBED

Thu Oct 27 2022 12:40:10 GMT+0000 (Coordinated Universal Time)

Saved by @usamahanif48 #react #antd #pagination

import { Pagination } from "antd";

const [currentPage, setCurrentPage] = useState(1);
  const [itemPerPage, setItemPerPage] = useState(25);

const indexOfLastItem = currentPage * itemPerPage;
  const indexOfFirstItem = indexOfLastItem - itemPerPage;
  const currentItem = users.slice(indexOfFirstItem, indexOfLastItem);

//IMP. NOTE {(curretitem.map)map also run by curretitem}

    <Pagination
                total={users.length}
                current={currentPage}
                pageSize={itemPerPage}
                onChange={(currentPage) => setCurrentPage(currentPage)}
              />



content_copyCOPY

Current item sai map chle ga { "users" } mtlb complete data from API

https://www.youtube.com/watch?v=kM73pwJpT1M