Commit ab075a2
authored
Do not unmount layout effects on initial Offscreen mount (#25592)
`wasHidden` is evaluted to false if `current` is null. This means
Offscreen has never been shown but this code assumes it is going from
'visible' to 'hidden' and unmounts layout effects.
To fix this, only unmount layout effects if `current` is not null.
I'm not able to repro this problem or write unit test for it. I see this
crash bug in production test.
The problem with repro is that if Offscreen starts as hidden, it's
render is deferred and current is no longer null.1 parent 765805b commit ab075a2
File tree
3 files changed
+42
-2
lines changed- packages/react-reconciler/src
- __tests__
3 files changed
+42
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2880 | 2880 | | |
2881 | 2881 | | |
2882 | 2882 | | |
2883 | | - | |
| 2883 | + | |
| 2884 | + | |
2884 | 2885 | | |
2885 | 2886 | | |
2886 | 2887 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2880 | 2880 | | |
2881 | 2881 | | |
2882 | 2882 | | |
2883 | | - | |
| 2883 | + | |
| 2884 | + | |
2884 | 2885 | | |
2885 | 2886 | | |
2886 | 2887 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
271 | 309 | | |
272 | 310 | | |
273 | 311 | | |
| |||
0 commit comments