Migrate to a monorepo structure (#2909)
This commit is contained in:
14
packages/twenty-front/src/hooks/useFirstMountState.ts
Normal file
14
packages/twenty-front/src/hooks/useFirstMountState.ts
Normal file
@ -0,0 +1,14 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user