I am trying to display the key entered value in the console. Right now I'm debugging. It's going inside the keyPress function, but I don't see any logs printed.
console.log("keyPress--->", e);
Can you tell me how to fix it so that in the future I will fix it myself.
I used this link as a reference: How to get input textfield values when enter key is pressed in react js?
I am providing my code snippet and sandbox here. All my code is in tab-demo.js
handleChangeText(e) {
debugger;
console.log("handleChangeText--->", e);
this.setState({ value: e.target.value });
}
keyPress(e) {
debugger;
console.log("keyPress--->", e);
if (e.keyCode == 13) {
console.log("value", e.target.value);
// put the login here
}