import { useEffect, useRef } from "react";
export default function useIsMounted() {
const is_mounted_ref = useRef<boolean>(false);
useEffect(() => {
is_mounted_ref.current = true;
return () => {
is_mounted_ref.current = false;
};
}, []);
return is_mounted_ref;
}