UNPKG

@sitecore/sc-contenthub-blok

Version:

A UI library for [Sitecore Content Hub](https://doc.sitecore.com/ch/).

19 lines 591 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const react_1 = require("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 = (0, react_1.useRef)(false); (0, react_1.useEffect)(() => { isMounted.current = true; return () => { isMounted.current = false; }; }, []); return isMounted; }; exports.default = useIsMounted; //# sourceMappingURL=useIsMounted.js.map