mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
16 lines
422 B
TypeScript
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;
|