React实际上将方法自动绑定到当前组件:
http://facebook.github.io/react/blog/2013/07/02/react-v0-4-autobind-by-
default.html
在TodoList组件中,而不是:
scope.props.onRemoveItem.bind(this, i)
尝试:
scope.props.onRemoveItem.bind(null, i)
通过提供
null而不是
this您,您将允许React自己做自己的事情。您还需要实际使用onClick处理程序:
<li onClick={this.props.onClick}>{this.props.task}</li>


