const Enter = () => { const handle = () => console.log('Enter pressed'); return <input type="text" onKeyDown={e => e.key === 'Enter' && handle} />; };