While searching for a solution, I stumbled upon this link which unfortunately did not provide the answer I was looking for: Cannot use 'new' with an expression whose type lacks a call or construct signature
I am facing a similar issue. In my JavaScript code, the following snippet is causing trouble:
public clone(data) {
return new this.constructor({
...this.data,
...data,
});
}
An error is being flagged on this line: Cannot use 'new' with an expression whose type lacks a call or construct signature.ts(2351)
I need help with rewriting this in TypeScript. Any suggestions?