SyntheticEvent
SyntheticEvent
This reference guide documents the SyntheticEvent
wrapper that forms part of React's Event System. See the Handling Events guide to learn more.
Overview
Your event handlers will be passed instances of SyntheticEvent
, a cross-browser wrapper around the browser's native event. It has the same interface as the browser's native event, including stopPropagation()
and preventDefault()
, except the events work identically across all browsers.
If you find that you need the underlying browser event for some reason, simply use the nativeEvent
attribute to get it. Every SyntheticEvent
object has the following attributes:
boolean bubbles boolean cancelable DOMEventTarget currentTarget boolean defaultPrevented number eventPhase boolean isTrusted DOMEvent nativeEvent void pr