- 我試圖在響應中實現一個推箱。
- 但我得到一個錯誤。 Uncaught TypeError:超級表達式必須爲null或函數,而不是未定義
- 可以告訴我如何解決它。
- 下面提供。
https://jsfiddle.net/q7yvmsa3/4/文本框未捕獲TypeError:超級表達式必須爲null或函數,而不是未定義
class TwitterBox extends React.component {
constructor(props) {
super(props);
this.state = { enteredTextBoxvalue : '' };
}
// var textBoxValue = textbox.value();
// var totalCount = textBoxValue.count();
// if (totalCount > 140) {
// div.addCSS{ border: 1px solid red}
// }
render() {
return (<div>Hello {this.props.name}
<textarea value = "this.state.enteredTextBoxvalue">
there should be only 140 characters
</textarea>
</div>);
}
}
ReactDOM.render(
<Hello name="World" />,
document.getElementById('container')
);
你必須要在React.component一個錯字(應該是大寫C) – Thiatt
你在你的代碼有三個錯誤。我將它們修正爲:https:// jsfiddle。net/q7yvmsa3/7/ – zvona
@zvona如果你解釋一下你所修復的東西,那將是非常棒的......所以將來我會自己去做 –