table
table copied to clipboard
Pagination returns to initial index when data updated
so I am have a function inside a useEffect hooks
useEffect(() => {
getData('post')
}, [data])
and this is my table component
<DataTable columns={column} data={data} />
since data is alawys being updated my pagination would not let me pass to the second page and it always returns me to pageIndex 0.