* chore: use Nx workspace lint rules Closes #3162 * Fix lint * Fix lint on BE * Fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
15 lines
283 B
TypeScript
15 lines
283 B
TypeScript
import { useRef } from 'react';
|
|
|
|
export const useFirstMountState = (): boolean => {
|
|
// eslint-disable-next-line @nx/workspace-no-state-useref
|
|
const isFirst = useRef(true);
|
|
|
|
if (isFirst.current) {
|
|
isFirst.current = false;
|
|
|
|
return true;
|
|
}
|
|
|
|
return isFirst.current;
|
|
};
|