Created
September 13, 2018 22:21
-
-
Save webdevstar/29fcefc07b82d5fb243f409f34bb78bd 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> | |
); | |
} |
thanks
best
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Recently, the current keypress issue has been fixed by above way.