[FIX] typing: Component class should be generic on Props and Env

Otherwise, it prevents proper typing with typescript
This commit is contained in:
Géry Debongnie
2022-01-17 10:18:45 +01:00
committed by Aaron Bohy
parent 4f35f03986
commit 99b5e9ec55
3 changed files with 6 additions and 7 deletions
+3 -4
View File
@@ -1,19 +1,18 @@
import type { Env } from "../app/app";
import type { ComponentNode } from "./component_node";
// -----------------------------------------------------------------------------
// Component Class
// -----------------------------------------------------------------------------
export class Component {
export class Component<Props = any, Env = any> {
static template: string = "";
static props?: any;
props: any;
props: Props;
env: Env;
__owl__: ComponentNode;
constructor(props: any, env: Env, node: ComponentNode) {
constructor(props: Props, env: Env, node: ComponentNode) {
this.props = props;
this.env = env;
this.__owl__ = node;