React uses SyntheticEvent
, which is a cross-browser wrapper around the browser's native event. So all the event handlers in the react applications will be passed instances of SyntheticEvent
. React's event ecosystem has the same interface as any of the browser's native events with the advantage that it works identically in all the browsers and provides stopPropagation
() and preventDefault
() too.
If React is installed as an NPM module, then these SyntheticEvent
-related files can be found in the following location within your app: app/node_modules/react/lib
.
All these events comply with the W3C standard. The main event flow happens as:
Dispatching the event :
@param {object} dispatchConfig
Marker identifying the event target:
@param {object} dispatchMarker
Native event:
@param {object} nativeEvent
The way React uses this event delegation is by listening to the nodes that have listeners. Depending on the event handlers on the particular node, the synthetic event system of React implements its...