UNPKG

react-box-overflow

Version:

Headless UI for automatically collapsing boxes when overflow in React.

14 lines (13 loc) 310 B
import { useRef, useCallback } from "react"; function useRefFn(fn) { const fnRef = useRef(); fnRef.current = fn; return useCallback((...params) => { var _a; (_a = fnRef.current) == null ? void 0 : _a.call(fnRef, ...params); }, []); } export { useRefFn }; //# sourceMappingURL=useRefFn.js.map