UNPKG

rsuite

Version:

A suite of react components

13 lines (10 loc) 376 B
import { useEffect, useRef } from 'react'; var useMount = function useMount(callback) { var mountRef = useRef(callback); mountRef.current = callback; useEffect(function () { var _mountRef$current; (_mountRef$current = mountRef.current) === null || _mountRef$current === void 0 ? void 0 : _mountRef$current.call(mountRef); }, []); }; export default useMount;