mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 12:38:27 -04:00
14 lines
243 B
TypeScript
14 lines
243 B
TypeScript
import { useRef } from "react";
|
|
|
|
export const useFirstMountState = (): boolean => {
|
|
const isFirstMount = useRef(true);
|
|
|
|
if (isFirstMount.current) {
|
|
isFirstMount.current = false;
|
|
|
|
return true;
|
|
}
|
|
|
|
return isFirstMount.current;
|
|
};
|