【发布时间】:2017-08-09 23:07:40
【问题描述】:
我真的想将一些数据传递给我也绑定它的方法,例如:
<MyComponenet
onPress={this.logUser('blabla').bind(this)}
>
但如你所知,它给了我Cannot read property 'bind' of undefine
那是什么
【问题讨论】:
我真的想将一些数据传递给我也绑定它的方法,例如:
<MyComponenet
onPress={this.logUser('blabla').bind(this)}
>
但如你所知,它给了我Cannot read property 'bind' of undefine
那是什么
【问题讨论】:
哦,知道了,应该是这样的
<Button
onPress={this.logUser.bind(this, 'sina :)')}
>
把这个问题留在堆栈上,以防其他人有同样的问题
【讨论】: