-
-
Save nodetop/f1279d69ad89ee05e054de201ef79b77 to your computer and use it in GitHub Desktop.
React Key events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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