BIG-88: Reset table state once the table unmount.

This commit is contained in:
a.bouhuolia
2021-09-15 16:31:58 +02:00
parent df0cfcfdae
commit fffc5af980
9 changed files with 33 additions and 31 deletions

View File

@@ -24,18 +24,14 @@ function ExpensesList({
expensesTableStateChanged,
// #withExpensesActions
setExpensesTableState,
resetExpensesTableState,
}) {
// Resets the accounts table state once the page unmount.
useEffect(
() => () => {
setExpensesTableState({
filterRoles: [],
viewSlug: '',
pageIndex: 0,
});
resetExpensesTableState();
},
[setExpensesTableState],
[resetExpensesTableState],
);
return (