react的props的es6寫法問題//1.為毛要super??還要bind?不能直接this.props么?class Count extends React.Component{
constructor(props){ super(props); //為毛要super??
this.oddChange=this.oddChange.bind(this);
}render(){ const {value,add,sub}=this.props //2.為什么是這樣子的寫法?然后就不用super了?
return (
<div>
<span>{value}</span>有點亂,希望大神解釋下
react的es6,props獲取的問題?
GCT1015
2018-10-19 14:09:21