liveBook · Manning

nativeEvent property

As explained in React Quickly, Second Edition

The nativeEvent property provides access from a React synthetic event to the underlying browser-native event object.

The nativeEvent property exposes the underlying browser-native event from a React synthetic event. Use it when browser-specific information is needed beyond the standard React event API. section 8.2.3

Accessing browser-specific event data

When a particular browser provides extra information useful to an application, read that information through the event's nativeEvent property. Treat nativeEvent as a nonstandard, React-only extension rather than a standard event property. section 8.2.3

How React Quickly, Second Edition covers it

How deep it goes
Defines the property and its purpose, while deferring specific properties and methods to React's synthetic event API documentation.
Examples
Uses browser-specific extra information as the motivating example and contrasts it with mouse and pointer coordinates such as pageX and pageY.
What it assumes
Assumes familiarity with React event objects and the distinction between synthetic and browser-native events.
What you can do after
Apply it by reading nativeEvent when a React event must expose browser-specific information.
How it connects
Connects React synthetic events with underlying browser-native events and event-specific properties such as pageX and pageY.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of React Quickly, Second Edition. The section links point to the parts of the book it draws on.