Normalize Events with Reacts Synthetic Event System

Joe Maddalone
InstructorJoe Maddalone

Share this video with your friends

Send Tweet

Event handlers are passed an instance of SyntheticEvent in React. In this video we'll take a look at the wide range of events available to us, including Touch events.

Connie Yu
Connie Yu
~ 4 years ago

Hi, I love your lessons about React. Can you share what autocomplete/shortcut plugins you are using?

Thank you

Vishwas Chouhan
Vishwas Chouhan
~ 3 years ago

this.update = this.update.bind(this) } update(e){ this.setState({currentEvent: e.type}) } render(){ return ( <div> <textarea onKeyPress={this.update}

Confused with the reference to this.update in the constructor, then the eventHandler for textarea calling this.update

onKeyPress={this.update} won't this call the method? Why do we need to have this.update in the constructor binding this.update = this.update.bind(this)?

Do we explicitly need to bind this in ES6?

Yaswanth
Yaswanth
~ 2 years ago

to avoid binding in a constructor, the 'update' method should be an array function.

daniel
daniel
~ 2 years ago

hi, Im getting a index.js:1446 Warning: Expected onTouchStart listener to be a function, instead got a value of boolean type. wsid?