Skip to content

Commit 2db4456

Browse files
committed
Don´t run corrupt state check on state change
The goal of useTableFilterStateValidation is to fix state when switching between ui versions. We do not need to fix state while the app is running, Therefore I think it is reasonable to run it only once on load, in order to reduce rerenders.
1 parent 3d3bd0b commit 2db4456

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/hooks/useTableFilterStateValidation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ export const useTableFilterStateValidation = () => {
2222
console.warn("Detected corrupted table filter state, resetting to defaults");
2323
dispatch(resetCorruptedState());
2424
}
25-
}, [dispatch, tableFilters.data, tableFilters.textFilter, tableFilters.stats]);
25+
// eslint-disable-next-line react-hooks/exhaustive-deps
26+
}, []);
2627
};

0 commit comments

Comments
 (0)