Fixed pagination
This commit is contained in:
parent
47a38c45b2
commit
01b12d7e9d
@ -227,12 +227,11 @@ const AllTaskTableTracker = ({ filteredAllTasks, projects, loader }) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setItems(filteredAllTasks);
|
setItems(filteredAllTasks);
|
||||||
|
const endOffset = itemOffset + itemsPerPage;
|
||||||
|
setCurrentItems(filteredAllTasks.slice(itemOffset, endOffset));
|
||||||
|
setPageCount(Math.ceil(filteredAllTasks.length / itemsPerPage));
|
||||||
}, [filteredAllTasks]);
|
}, [filteredAllTasks]);
|
||||||
|
|
||||||
// Баг с отрисовкой массив currentItems пустой
|
|
||||||
console.log(currentItems);
|
|
||||||
console.log(items);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const endOffset = itemOffset + itemsPerPage;
|
const endOffset = itemOffset + itemsPerPage;
|
||||||
setCurrentItems(items.slice(itemOffset, endOffset));
|
setCurrentItems(items.slice(itemOffset, endOffset));
|
||||||
|
Loading…
Reference in New Issue
Block a user