4 ms·
Maybe I'm missing something but your first example in React can just be: const B = ({onClick}) => <div onClick={onClick} />; function C() { const A =
by pjgalbraith 5y ago
Maybe I'm missing something but your first example in React can just be:
const B = ({onClick}) => <div onClick={onClick} />;
function C() {
const A = {
something: () => console.log("hi")
};
return <B onClick={() => A.something()} />;
}