1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/frontend/src/hooks/useHiddenColumns.ts

16 lines
422 B
TypeScript
Raw Normal View History

import { useEffect } from 'react';
import { IdType } from 'react-table';
const useHiddenColumns = (
setHiddenColumns: <D>(param: Array<IdType<D>>) => void,
hiddenColumns: string[],
condition: boolean
) => {
useEffect(() => {
const hidden = condition ? hiddenColumns : [];
setHiddenColumns(hidden);
2022-08-08 15:21:23 +02:00
}, [setHiddenColumns, hiddenColumns, condition]);
};
export default useHiddenColumns;