Pagination not working client side?? #5658
-
It's simple but somehow not working in your code?? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
MY ISSUE WAS RESOLVED BY CHAT.GPT SO FIRST CHECK THAT OUT. |
Beta Was this translation helpful? Give feedback.
Make sure imports are proper-
import { flexRender, getCoreRowModel, useReactTable, getPaginationRowModel} from "@tanstack/react-table";
Try custom settings for pagination
const [pagination, setPagination] = useState({
pageIndex: 0,
pageSize: 10,
pageCount: Math.ceil(final,Data.length / 10),
})
Dont forget these --
const table = useReactTable({
data,
columns,
state: { pagination },
onPaginationChange: setPagination,
getCoreRowModel: getCoreRowModel(),
getPaginationRowModel: getPaginationRowModel(),
debugTable: true,
});
My Issue that forced me to create this discussion--
In my code of table body, while rendering table data we use the below line--
{table.getRowModel().rows.map(row =…