mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
339d6cb32b
In sync mode, we downgrade sync priority work to task work when we're in the commit phase, but not in the render phase. That means if you schedule updates in both phases, the render phase update will flush first, and the commit phase update will flush after that. What should really happen is that both updates flush at the same time. To solve this, updates in the commit phase are now given sync priority. The distinction between task and sync really only exists to account for a historical quirk in the behavior of top-level mounts. (Refer to the test case titled "initial mount is sync inside batchedUpdates".) Ideally, there would only be one priority for both sync and task. This gets us closer to that model, while still accounting for top-level mounts.