Commit fdbae73
committed
Avoid crashing renders given rendering races
If two OutPortals are ever rendered at the same time, the second
will steal the content from the first. When the first unmounts,
it accidentally unmounts the content from the second, so when
the second unmounts, it crashes.
This will always happen if you have two renders simultaneously,
and it seems it can also happen if they're not simultaneous but
maybe React has only started unmounting one element when it
mounts another (is this possible? seems to be happening, but
very unclear).
I'll extend this to avoid the issue entirely shortly, but this
fixes the immediate crash.1 parent 8805c73 commit fdbae73
1 file changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
0 commit comments