zhouzhongyuan / qa

Questions recods
MIT License
5 stars 1 forks source link

What is SyntheticEvent in react? #89

Open zhouzhongyuan opened 7 years ago

zhouzhongyuan commented 7 years ago

To Read

重要

https://www.youtube.com/watch?v=dRo_egw7tBc https://github.com/facebook/react/pull/7616/files

zhouzhongyuan commented 7 years ago

.

zhouzhongyuan commented 7 years ago

Browsers fire mouse events after touch events.

What does it mean?

TouchEvent -> MouseEvent

It means:

It's important to note that in many cases, both touch and mouse events get sent (in order to let non-touch-specific code still interact with the user). If you use touch events, you should call preventDefault() to keep the mouse event from being sent as well.

form TouchEvent - Web APIs | MDN

Touch event types(All)

touchstart

touchend

touchmove

touchcancel

Mouse event types(Common using)

click

dblclick

mouseup

mousedown

zhouzhongyuan commented 7 years ago

How does click event listener callback be added?

Intro