if you don't want to writing bind in the constructor, you can write your event with arrow function.
render()
return <input onKeyPress = {() =>
this.handleOnKeyPress() }/>
}
After that you can delete your binding code line of component.
if you don't want to writing bind in the constructor, you can write your event with arrow function.
render()
return <input onKeyPress = {() =>
this.handleOnKeyPress() }/>
}
After that you can delete your binding code line of component.