Page MenuHomec4science

useEventCallback.js
No OneTemporary

File Metadata

Created
Fri, Jan 24, 18:37

useEventCallback.js

import { useCallback } from 'react';
import useCommittedRef from './useCommittedRef';
export default function useEventCallback(fn) {
var ref = useCommittedRef(fn);
return useCallback(function () {
return ref.current && ref.current.apply(ref, arguments);
}, [ref]);
}

Event Timeline