Any native event handlers will fire before React event handlers.

This is how React works with events:

  1. It listens to events at the top-level and converts them to Synthetic Events
  2. Puts them in a pool to maintain order
  3. Dispatches to React components

Because of this, order is maintained within the React ecosystem but out of order relative to the rest.

As explained in this video:

And vaguely described in the docs:

Related Query

More Query from same tag