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
andreas-unleash 18afc34f85 fix build
2022-08-08 16:21:23 +03:00

16 lines
422 B
TypeScript

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);
}, [setHiddenColumns, hiddenColumns, condition]);
};
export default useHiddenColumns;