Skip to content

Instantly share code, notes, and snippets.

@nodetop
Forked from webdevstar/Keyevent.js
Created October 3, 2018 05:13
Show Gist options
  • Save nodetop/f1279d69ad89ee05e054de201ef79b77 to your computer and use it in GitHub Desktop.
Save nodetop/f1279d69ad89ee05e054de201ef79b77 to your computer and use it in GitHub Desktop.
React Key events
handleKeyPress = (event) => {
if(event.key == 'Enter'){
console.log('enter press here! ')
}
}
render: function(){
return(
<div>
<input type="text" id="one" onKeyPress={this.handleKeyPress} />
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment