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.

原文地址:https://www.cnblogs.com/douglasvegas/p/7055503.html