Clear finished discrete updates during commit phase by jddxf · Pull Request #18515 · react/react (original) (raw)
Make sure the suspended level is marked as pinged so that we return back to it later, in case the render we're about to start gets aborted. Generally we only reach this path via a ping, but we shouldn't assume that will always be the case.
If a root is finished at a priority lower than that of the latest pending discrete
updates on it, these updates must have been finished so we can clear them now.
Otherwise, a later call of flushDiscreteUpdates would start a new empty render
pass which may cause a scheduled timeout to be cancelled.
Happened to find this while writing a test. A JSX element comparison failed because one of them elements had a functional component as an owner, which should ever happen.
I'll add a regression test later.
acdlite added a commit to acdlite/react that referenced this pull request
Adds a regression test for the same underlying bug as react#18515 but using pings.
Test already passes, but I confirmed it fails if you revert the fix in react#18515.
acdlite added a commit that referenced this pull request
- Add another test for #18515 using pings
Adds a regression test for the same underlying bug as #18515 but using pings.
Test already passes, but I confirmed it fails if you revert the fix in #18515.
- Set nextPendingLevel after commit, too
jddxf deleted the lost-fallback branch
This was referenced
Sep 8, 2024
This was referenced
Sep 20, 2024
This was referenced
Oct 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})