3 ms·
The event handling was something I also thought I didn't want at first. It is actually important though because it allows you to register event handlers before
by aboodman 13y ago
The event handling was something I also thought I didn't want at first. It is actually important though because it allows you to register event handlers before the component is mounted in the DOM, which comes up all the time because of the stateless abstraction React provides.
React's event handlers also serve as a unit under which state updates are batched. In a normal DOM event state updates are performed synchronously. (It seems like rAF should allow batching by default, but this hasn't been enabled because of some edge-case related to unit testing that I don't quite understand.)