React知識點梳理(持續更新中)

傳統HTML中<div onclick="handleclick()"></div>handleclick函數自動綁定了this,而react中<div onClick={handleclick}"></div>須要手動綁定,下面是回調函數綁定this的三種方法react bind(this) constructor(props){ super(props); this.state={};
相關文章
相關標籤/搜索