[FIX] component: protect against user code executing in critical section

Canceling a fiber may cause user code to be run, which means that some
new renderings could be scheduled, but this could interfere with the
current renderings!
This commit is contained in:
Géry Debongnie
2022-03-31 13:48:45 +02:00
committed by Sam Degueldre
parent 7fb166bd50
commit fd13277e1d
4 changed files with 135 additions and 4 deletions
+2 -4
View File
@@ -79,10 +79,8 @@ export function component<P extends object>(
let node: any = ctx.children[key];
let isDynamic = typeof name !== "string";
if (node) {
if (node.status === STATUS.DESTROYED) {
node = undefined;
}
if (node && node.status === STATUS.DESTROYED) {
node = undefined;
}
if (isDynamic && node && node.component.constructor !== name) {
node = undefined;