如何使用箭头函数(公共类字段)作为类方法?
class SomeClass extends React.Component {
// Instead of this
constructor(){
this.handleInputChange = this.handleInputChange.bind(this)
}
// Can I somehow do this? Am i just getting the syntax wrong?
handleInputChange (val) => {
console.log('selectionMade: ', val);
}SomeClass.handleInputChangesetTimeoutwindow
智慧大石
MMTTMM
泛舟湖上清波郎朗
莫回无
随时随地看视频慕课网APP