UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

13 lines (12 loc) 333 B
import * as React from 'react'; /** Similar with `useEffect` but only trigger after mounted */ export default (function (callback, conditions) { var mountRef = React.useRef(false); React.useEffect(function () { if (mountRef.current) { callback(); } else { mountRef.current = true; } }, conditions); });