Code:
export class NumberInput extends HTMLElement {
constructor(...args: any) {
super(...args);
Error log :
Error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter.
(anonymous) @ example.js:1
Any suggestion! thanks
CodePudding user response:
Yup, as CaTS says it, ConstructorParameters
is the way to go.
export class NumberInput extends HTMLElement {
constructor(...args: ConstructorParameters<typeof HTMLElement>) {
super(...args);
}
}