react 里面的函数is not a function 问题!

react小白,再自己编写todolist小dome的时候,遇到的
代码一直提示props.handleItemDelete is not a function。 大神能不能帮找一下问题 谢谢了

gitHub地址:https://github.com/nn0403/myT...

阅读 5.9k
2 个回答

这里要 bind 一下吧

clipboard.png

这里要继承一下吧

clipboard.png

没bind 你执行的时候相当于this.handleItemDelete(this)()

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题