The problem is that the systems accept only the default ComponentConstructor here. When creating custom component that doesn't need any schema, the developer ends up stuck with a constructor like:
export class FrameComponent extends Component<FramingParameters> {
public target: Nullable<Target>;
public constructor(target?: Target) {
super(target);
this.target = target ?? null;
}
...
}
Which would work only if:
The props argument contains attributes of the class ({ target: ... } in this case)
The props argument can be false
Fix
1. Make the system class accept more generic component constructor
2. Re-think the instantiation / reset of component
Regarding the constructor accepting false as props, wouldn't it make more sense to completely disable the schema check using a static argument? I am not sure what would be the use case of disabling the props schema per instance.
Would it be possible to allow to forward properties that aren't of this type?
Hi,
Right now, component constructor accepts only objects containing the same attributes as the component, and
false
to use schema or not:The problem is that the systems accept only the default ComponentConstructor here. When creating custom component that doesn't need any schema, the developer ends up stuck with a constructor like:
Which would work only if:
props
argument contains attributes of the class ({ target: ... }
in this case)props
argument can be falseFix
1. Make the system class accept more generic component constructor
2. Re-think the instantiation / reset of component
Regarding the constructor accepting
false
as props, wouldn't it make more sense to completely disable the schema check using astatic
argument? I am not sure what would be the use case of disabling the props schema per instance.Would it be possible to allow to forward properties that aren't of this type?
Let me know what you think! Thanks