Skip to content

Commit

Permalink
act: Move didScheduleLegacyUpdate to ensureRootIsScheduled
Browse files Browse the repository at this point in the history
`act` uses the `didScheduleLegacyUpdate` field to simulate the behavior
of batching in React <17 and below. It's a quirk leftover from a
previous implementation, not intentionally designed.

This sets `didScheduleLegacyUpdate` every time a legacy root receives an
update as opposed to only when the `executionContext` is empty. There's
no real reason to do it this way over some other way except that it's
how it used to work before facebook#26512 and we should try our best to maintain
the existing behavior, quirks and all, since existing tests may have
come to accidentally rely on it.

This should fix some (though not all) of the internal Meta tests that
started failing after facebook#26512 landed.
  • Loading branch information
acdlite committed Apr 4, 2023
1 parent d5fd60f commit add2b23
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit add2b23

Please sign in to comment.