Synthetic Event
In one line
SyntheticEvent wraps native events to provide consistent cross-browser behavior and pooling.
In simple words
SyntheticEvent is React's wrapper around the browser's native event object. It normalizes events so they behave the same across all browsers, eliminating cross-browser quirks.
Properties include: target, currentTarget, type, nativeEvent, preventDefault(), stopPropagation().
React 16 and earlier used event pooling — SyntheticEvent objects were reused for performance, so you had to call e.persist() to use them asynchronously. React 17+ removed event pooling.
React attaches event listeners to the document (React 16) or root container (React 17+) rather than individual DOM nodes — this is event delegation for performance.
Example
function Form() {
function handleSubmit(e) {
// e is a SyntheticEvent
e.preventDefault(); // Cross-browser
console.log(e.target); // The <form> element
console.log(e.nativeEvent); // Original browser event
// e.type, e.currentTarget, etc.
}
function handleChange(e) {
// SyntheticInputEvent
console.log(e.target.value); // Input value
}
return (
<form onSubmit={handleSubmit}>
<input onChange={handleChange} />
<button type="submit">Submit</button>
</form>
);
}SyntheticEvent wraps the native event with consistent cross-browser behavior. Access the original via e.nativeEvent if needed.
Common confusions
Confused with: native event
The difference: A native event is the raw browser Event object with browser-specific quirks. SyntheticEvent is React's wrapper that normalizes behavior across browsers. Access the native event via e.nativeEvent. SyntheticEvent has the same interface but consistent behavior.
Related terms
Related Resources
Related Lessons
- React Events
Synthetic events.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.