I'getting在構造函數中未定義此錯誤。 讓我知道這是什麼原因。我從源文件中讀取,編譯器會自動創建構造函數並可用此引用,或者需要使用super()作爲第一個語句手動添加構造函數。ReactJS構造函數'this'未定義錯誤
class A extends Component {
constructor() {
// this undefined error
console.log('construtor');
this.state = {name: ''}
}
}