Как отследить нажатие enter в react-native?
При вводе данных в получаю undefined
class SearchCityScreen extends React.Component {
constructor(props) {
super(props);
}
handleKeyPress = (e) => {
console.log(e.key);
if (e.key === "Enter") {
console.log("do validate");
}
};
render() {
return (
<TextInput style={styles.textInput} onKeyPress={this.handleKeyPress} />
);
}
}

