mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
16 lines
407 B
TypeScript
16 lines
407 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, condition]);
|
||
|
};
|
||
|
|
||
|
export default useHiddenColumns;
|