在es6写法中,绑定事件的事件的回调是全局,顾返回的为undefined
解决办法:
1.使用es6箭头函数,箭头函数this默认指向上一层级的环境 如 <input onChange={()=>this.change()} />
2.使用bind绑定this ,写在constructor里 如 this.change = this.change.bind(this);
react es6中 this undefined
原文:http://www.cnblogs.com/rp-jscript/p/7787078.html