Eventually I'm trying to move the object on the screen using keyboard arrow keys. At the moment I'm trying to see if the code responds to keys. It does not. I press arrow up and nothing gets output to browser console.
_handleKey(event){
console.log(event);
if(event.keyCode == 38){
console.log("Arrow Up");
}
}
componentDidMount() {
document.addEventListener("keyPress", this._handleKey, false);
}
The full code is here: http://codepen.io/wasteland/pen/GZvWeo
What do I do wrong?