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>有点乱,希望大神解释下
添加回答
举报
0/150
提交
取消