enable enter button react code example
Example: capture enter button react input
const Enter = () => {
const handle = () => console.log('Enter pressed');
return <input type="text" onKeyDown={e => e.key === 'Enter' && handle} />;
};
const Enter = () => {
const handle = () => console.log('Enter pressed');
return <input type="text" onKeyDown={e => e.key === 'Enter' && handle} />;
};