Here is my React.js component definition:
class ExampleComponent1 extends React.Component {
constructor() {
super();
}
}
When webpack this with babel loader, everything would be fine. But then I change the constructor
declare to arrow function:
class ExampleComponent1 extends React.Component {
constructor = () => {
super();
}
}
webpack build failed:
Module build failed: SyntaxError:....: 'super' outside of function or class (8:4)
I don't know why this happened, constructor can't declare as arrow function?