Keypress event is deprecated, You should use Keydown event instead.
https://developer.mozilla.org/en-US/docs/Web/API/Document/keypress_event
handleKeyDown(event) {
if(event.keyCode === 13) {
console.log('Enter key pressed')
}
}
render() {
return <input type="text" onKeyDown={this.handleKeyDown} />
}