UNPKG

@drivy/cobalt

Version:

Opinionated design system for Drivy's projects.

15 lines (12 loc) 401 B
import { useRef, useEffect } from 'react'; const useOnMountEffect = (callBack) => { const mounted = useRef(false); return useEffect(() => { if (!mounted.current) { mounted.current = true; callBack === null || callBack === void 0 ? void 0 : callBack(); } }, [callBack]); }; export { useOnMountEffect }; //# sourceMappingURL=useOnMountEffect.js.map