[FIX] remove cyclic dependency, improve error typing (#982)

This commit is contained in:
Géry Debongnie
2021-11-18 10:44:49 +01:00
committed by Aaron Bohy
parent ed3e6dcbb6
commit 093218a067
3 changed files with 15 additions and 18 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ export class ComponentNode<T extends typeof Component = any> implements VNode<Co
try {
await Promise.all(this.willStart.map((f) => f.call(component)));
} catch (e) {
handleError(this, e as Error);
handleError({ node: this, error: e });
return;
}
if (this.status === STATUS.NEW && this.fiber === fiber) {
@@ -161,7 +161,7 @@ export class ComponentNode<T extends typeof Component = any> implements VNode<Co
fiber.bdom = this.renderFn();
fiber.root.counter--;
} catch (e) {
handleError(this, e as Error);
handleError({ node: this, error: e });
}
}