there is a class A
, SubA inherits A, but the console reports an error Class constructor xxx cannot be invoked without "new"
how to solve it?
//A
class A{
constructor() {}
};
export default A
//A
import A from "xxx"
class SubA extends A{
constructor() {
super();
}
};
export default SubA
//
import A from "xxx"
import SubA from "xxx"
let B = new A(); //
let B0 = new SubA(); //
this error is very strange, there is nothing wrong with another program to do so, this is the problem here. The path of the file is checked correctly, and there is no error in the variable name.