@sitecore/sc-contenthub-blok
Version:
A UI library for [Sitecore Content Hub](https://doc.sitecore.com/ch/).
17 lines • 494 B
JavaScript
import { useEffect, useRef } from "react";
/**
* Returns a RefObject to check if the component is mounted.
* @returns An object with readonly current property to check the mounted state.
*/
const useIsMounted = () => {
const isMounted = useRef(false);
useEffect(() => {
isMounted.current = true;
return () => {
isMounted.current = false;
};
}, []);
return isMounted;
};
export default useIsMounted;
//# sourceMappingURL=useIsMounted.js.map