Event System
February 9, 20261 min readpart 08/13
React doesn't attach listeners to individual DOM nodes. It uses event delegation — a single listener on the root container for each event type, registered during createRoot().
When a native event fires and bubbles to the root, React constructs a SyntheticEvent, walks the Fiber tree from target to root collecting handlers, and dispatches them in order (capture then bubble). Different events get different priorities: discrete events (click, keydown) → SyncLane, continuous events (mousemove, scroll) → InputContinuousLane.
Further reading
- How React's Event System Works (deep dive) jser.dev on delegation, SyntheticEvent pooling, and priority assignment
- Changes to Event Delegation in React 17 (blog) React team explains moving delegation from document to root container
- ReactDOMEventListener.js (source) Where native events enter React's system; priority mapping lives here