Commit f440bfd
authored
Bugfix: Effects should never have higher than normal priority (#16257)
* Bugfix: Priority when effects are flushed early
The priority of passive effects is supposed to be the same as the
priority of the render. This fixes a bug where the priority is sometimes
wrong if the effects are flushed early.
But the priority should really never be higher than Normal Priority.
I'll change that in the next commit.
* Effects never have higher than normal priority
Effects currently have the same priority as the render that spawns them.
This changes the behavior so that effects always have normal priority,
or lower if the render priority is lower (e.g. offscreen prerendering).
The implementation is a bit awkward because of the way `renderRoot`,
`commitRoot`, and `flushPassiveEffects` are split. This is a known
factoring problem that I'm planning to address once 16.9 is released.1 parent db3ae32 commit f440bfd
File tree
3 files changed
+79
-23
lines changed- packages/react-reconciler/src
- __tests__
3 files changed
+79
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| 241 | + | |
240 | 242 | | |
241 | 243 | | |
242 | 244 | | |
| |||
1494 | 1496 | | |
1495 | 1497 | | |
1496 | 1498 | | |
1497 | | - | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
1498 | 1504 | | |
1499 | 1505 | | |
1500 | 1506 | | |
1501 | | - | |
1502 | | - | |
| 1507 | + | |
1503 | 1508 | | |
1504 | 1509 | | |
1505 | 1510 | | |
1506 | 1511 | | |
1507 | 1512 | | |
1508 | 1513 | | |
1509 | 1514 | | |
1510 | | - | |
| 1515 | + | |
1511 | 1516 | | |
1512 | 1517 | | |
1513 | 1518 | | |
| |||
1730 | 1735 | | |
1731 | 1736 | | |
1732 | 1737 | | |
| 1738 | + | |
1733 | 1739 | | |
1734 | 1740 | | |
1735 | 1741 | | |
| |||
1937 | 1943 | | |
1938 | 1944 | | |
1939 | 1945 | | |
| 1946 | + | |
1940 | 1947 | | |
1941 | 1948 | | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
1942 | 1957 | | |
| 1958 | + | |
1943 | 1959 | | |
1944 | 1960 | | |
1945 | 1961 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
Lines changed: 58 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 155 | | |
162 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
165 | 175 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
170 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
171 | 214 | | |
172 | 215 | | |
173 | 216 | | |
| |||
213 | 256 | | |
214 | 257 | | |
215 | 258 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | 259 | | |
0 commit comments