dillon1000/react

Commit

Fix native event batching in concurrent mode (#21010)

* Fix native event batching in concurrent mode

* Wrap DevTools test updates with act

These tests expect the `scheduleUpdate` DevTools hook to trigger a
synchronous re-render with legacy semantics, but flushing in a microtask
is fine. Wrapping the updates with `act` fixes it.

* Testing nits

* Nit: Check executionContext === NoContext first

In the common case it will be false and the binary expression will
short circuit.

Co-authored-by: Andrew Clark <[email protected]>
Browse files
Changed paths4 files
First-parent comparison
M packages/react-debug-tools/src/__tests__/ReactDevToolsHooksIntegration-test.js ModifiedM packages/react-dom/src/__tests__/ReactDOMNativeEventHeuristic-test.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.new.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.old.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…