react functional component callback hook passing event object code example
Example: callback in react
import React, { useCallback } from 'react';
function MyComponent() {
// handleClick is the same function object
const handleClick = useCallback(() => { console.log('Clicked!'); }, []);
// ...
}