I need to throttle the mousemove event, and I follow the tips below to build the method, but doesn\'t work: Perform debounce in React.js
Here is my code (http://jsbin.co
With hooks:
const Tool = () => { const onMouseMove = useMemo(() => { const throttled = _.throttle(e => console.log(e.screenX), 300); return e => { e.persist(); return throttled(e); }; }, []); return ( Content ); };