TaskQueue: Error with task : undefined is not a function (evaluating 'this._renderReplies(replyCount)')
为什么我的函数是未定义的?
我在上面得到这个错误。
_renderReplies = (replyCount) => {
return (<Text>`View ${replyCount} replies`</Text>);
}
_renderItem(row) {
...
<View>{this._renderReplies(replyCount)}</View> <- Getting an error here
</View>
)
}
为什么我收到未定义功能错误????太奇怪了。
我想你忘了绑定'_renderItem'方法,正因为如此,检查。 –
我不认为我需要绑定它,因为我正在使用这个语法'_renderReplies =(replyCount)=>'我还需要绑定吗? –
但你没有使用'_renderItem'的箭头函数,使用相同的方式它会工作:) –