Dashboard sipadu mbip
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

useEventCallback.js 276B

12345678
  1. import { useCallback } from 'react';
  2. import useCommittedRef from './useCommittedRef';
  3. export default function useEventCallback(fn) {
  4. var ref = useCommittedRef(fn);
  5. return useCallback(function () {
  6. return ref.current && ref.current.apply(ref, arguments);
  7. }, [ref]);
  8. }