[REF] allow external code to override validateTarget

This commit is contained in:
Géry Debongnie
2022-02-01 16:08:01 +01:00
committed by Aaron Bohy
parent 50aac42bdc
commit 83de53d283
3 changed files with 5 additions and 4 deletions
+3 -1
View File
@@ -28,6 +28,8 @@ export class App<
P = any,
E = any
> extends TemplateSet {
static validateTarget = validateTarget;
Root: ComponentConstructor<P, E>;
props: P;
env: E;
@@ -49,7 +51,7 @@ export class App<
}
mount(target: HTMLElement, options?: MountOptions): Promise<Component<P, E> & InstanceType<T>> {
validateTarget(target);
App.validateTarget(target);
const node = this.makeNode(this.Root, this.props);
const prom = this.mountNode(node, target, options);
this.root = node;