mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-07-20 17:45:57 -04:00
refactor more hooks
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { useRef } from "react";
|
||||
|
||||
const useFirstMountState = (): boolean => {
|
||||
const isFirstMount = useRef(true);
|
||||
|
||||
if (isFirstMount.current) {
|
||||
isFirstMount.current = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return isFirstMount.current;
|
||||
};
|
||||
|
||||
export default useFirstMountState;
|
||||
Reference in New Issue
Block a user