Files
twenty/packages/twenty-front/src/hooks/useFirstMountState.ts
T
2023-12-10 18:10:54 +01:00

15 lines
276 B
TypeScript

import { useRef } from 'react';
export const useFirstMountState = (): boolean => {
// eslint-disable-next-line twenty/no-state-useref
const isFirst = useRef(true);
if (isFirst.current) {
isFirst.current = false;
return true;
}
return isFirst.current;
};