Expected onClick listener to be a function, instead got type object

发布时间:2017-7-1 11:45:14编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"Expected onClick listener to be a function, instead got type object ",主要涉及到Expected onClick listener to be a function, instead got type object 方面的内容,对于Expected onClick listener to be a function, instead got type object 感兴趣的同学可以参考一下。

You need to remove the quotes. <li onClick={this.pageUp.bind(this)}>...

In vanilla javascript you would probably have onclick="somefunctionname". But not in JSX, yo need to pass a function as stated in the error.

Also, the .bind(this) is not necessary if you are using React.createClass, once you have removed the quotes you will probably get a warning stating that is not necessary since React does that for you.


上一篇:.NET Core程序中使用User Secrets存储敏感数据
下一篇:解决 ASP.NET Core Hangfire 未授权(401 Unauthorized)

相关文章

相关评论

本站评论功能暂时取消,后续此功能例行通知。

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。

好贷网好贷款