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.

 

posted @ 2017-06-20 17:59  douglasvegas  阅读(2089)  评论(0)    收藏  举报