UNPKG

@gravity-ui/graph

Version:

Modern graph editor component

9 lines (8 loc) 248 B
import { useCallback, useRef } from "react"; export function useFn(handler) { const handlerRef = useRef(handler); handlerRef.current = handler; return useCallback((...args) => { return handlerRef.current(...args); }, []); }