Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check for enter keyPress in react native

var Input = React.createClass({
  render: function () {
    return <input type="text" onKeyDown={this._handleKeyDown} />;
  },
  _handleKeyDown: function(e) {
    if (e.key === 'Enter') {
      console.log('do validate');
    }
  }
});

//inline
onSubmitEditing={"enter key pressed"}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #enter #keyPress #react #native
ADD COMMENT
Topic
Name
7+4 =