SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 114 JavaScript

Fix: Don't flush discrete at end of batchedUpdates (#21229)

The outermost `batchedUpdates` call flushes pending sync updates at the
end. This was intended for legacy sync mode, but it also happens to
flush discrete updates in concurrent mode.

Instead, we should only flush sync updates at the end of
`batchedUpdates` for legacy roots. Discrete sync updates can wait to
flush in the microtask.

`discreteUpdates` has the same issue, which is how I originally noticed
this, but I'll change that one in a separate commit since it requires
updating a few (no longer relevant) internal tests.
A
Andrew Clark committed
a1558600183b4321d4cdc117925980f1865641fa
Parent: 89847bf
Committed by GitHub <noreply@github.com> on 4/21/2021, 4:32:09 PM