Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix serial passive effects #15650
Flush passive effects before discrete events. Currently, we check for pending passive effects inside the
This is the same as the discrete/serial events problem. When a serial update comes in, and there's already a pending serial update, we have to do it before we call the user-provided event handlers. Because the event handlers themselves might change as a result of the pending update.
This commit moves the
ReactDOM: size: -0.1%, gzip: -0.2%
Details of bundled changes.
@gaearon In a real test I would simulate a click event. Since ReactNoop doesn't have an event system, I used
We already lack a first class way to create custom serial event handlers (e.g. key events in #14750). You can get most of the way there with event delegation: attach a single native event listener and wrap all the handlers in
You'd still need a way to force flush passive effects. We could expose
Regardless, that problem exists independently of the problem fixed by this PR (where