如何使用箭头函数(公共类字段)作为类方法?
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.handleInputChange
setTimeout
window
MMTTMM
泛舟湖上清波郎朗
莫回无
相关分类