Commit b38019b
committed
act: Move didScheduleLegacyUpdate to ensureRootIsScheduled (#26552)
`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 #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 #26512 landed.
Will add a regression test before merging.
DiffTrain build for commit fec97ec.1 parent 737b75e commit b38019b
File tree
13 files changed
+40
-31
lines changed- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
13 files changed
+40
-31
lines changedLines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19471 | 19471 | | |
19472 | 19472 | | |
19473 | 19473 | | |
| 19474 | + | |
| 19475 | + | |
| 19476 | + | |
| 19477 | + | |
| 19478 | + | |
19474 | 19479 | | |
19475 | 19480 | | |
19476 | 19481 | | |
| |||
20081 | 20086 | | |
20082 | 20087 | | |
20083 | 20088 | | |
20084 | | - | |
20085 | | - | |
20086 | | - | |
20087 | | - | |
| 20089 | + | |
| 20090 | + | |
20088 | 20091 | | |
20089 | 20092 | | |
20090 | 20093 | | |
| |||
23888 | 23891 | | |
23889 | 23892 | | |
23890 | 23893 | | |
23891 | | - | |
| 23894 | + | |
23892 | 23895 | | |
23893 | 23896 | | |
23894 | 23897 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8688 | 8688 | | |
8689 | 8689 | | |
8690 | 8690 | | |
8691 | | - | |
| 8691 | + | |
8692 | 8692 | | |
8693 | 8693 | | |
8694 | 8694 | | |
| |||
8719 | 8719 | | |
8720 | 8720 | | |
8721 | 8721 | | |
8722 | | - | |
| 8722 | + | |
8723 | 8723 | | |
8724 | 8724 | | |
8725 | 8725 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9114 | 9114 | | |
9115 | 9115 | | |
9116 | 9116 | | |
9117 | | - | |
| 9117 | + | |
9118 | 9118 | | |
9119 | 9119 | | |
9120 | 9120 | | |
| |||
9145 | 9145 | | |
9146 | 9146 | | |
9147 | 9147 | | |
9148 | | - | |
| 9148 | + | |
9149 | 9149 | | |
9150 | 9150 | | |
9151 | 9151 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
| 642 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
| 645 | + | |
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22560 | 22560 | | |
22561 | 22561 | | |
22562 | 22562 | | |
| 22563 | + | |
| 22564 | + | |
| 22565 | + | |
| 22566 | + | |
| 22567 | + | |
22563 | 22568 | | |
22564 | 22569 | | |
22565 | 22570 | | |
| |||
23175 | 23180 | | |
23176 | 23181 | | |
23177 | 23182 | | |
23178 | | - | |
23179 | | - | |
23180 | | - | |
23181 | | - | |
| 23183 | + | |
| 23184 | + | |
23182 | 23185 | | |
23183 | 23186 | | |
23184 | 23187 | | |
| |||
27184 | 27187 | | |
27185 | 27188 | | |
27186 | 27189 | | |
27187 | | - | |
| 27190 | + | |
27188 | 27191 | | |
27189 | 27192 | | |
27190 | 27193 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9555 | 9555 | | |
9556 | 9556 | | |
9557 | 9557 | | |
9558 | | - | |
| 9558 | + | |
9559 | 9559 | | |
9560 | 9560 | | |
9561 | 9561 | | |
| |||
9597 | 9597 | | |
9598 | 9598 | | |
9599 | 9599 | | |
9600 | | - | |
| 9600 | + | |
9601 | 9601 | | |
9602 | 9602 | | |
9603 | 9603 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10264 | 10264 | | |
10265 | 10265 | | |
10266 | 10266 | | |
10267 | | - | |
| 10267 | + | |
10268 | 10268 | | |
10269 | 10269 | | |
10270 | 10270 | | |
| |||
10319 | 10319 | | |
10320 | 10320 | | |
10321 | 10321 | | |
10322 | | - | |
| 10322 | + | |
10323 | 10323 | | |
10324 | 10324 | | |
10325 | 10325 | | |
| |||
0 commit comments