@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
25 lines (21 loc) • 560 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
// https://usehooks-typescript.com/react-hook/use-is-mounted
function useIsMounted() {
var isMounted = (0, _react.useRef)(false);
(0, _react.useEffect)(function () {
isMounted.current = true;
return function () {
isMounted.current = false;
};
}, []);
return (0, _react.useCallback)(function () {
return isMounted.current;
}, []);
}
var _default = useIsMounted;
exports.default = _default;