I\'m trying to log the click event on a button in react:
const InputBox = () => { const clicky = fromEvent( document.getElementById(\'clickMe\'),
Wrap it in useEffect() that's when the dom is ready
useEffect()
const InputBox = () => { const buttonEl = React.useRef(null); useEffect(() => { const clicky = fromEvent(buttonEl.current, 'click').subscribe(clickety => console.log({ clickety }) ); return () => clicky.unsubscribe(); }, []); return ( Click Me ); };