Expected onClick listener to be a function, instead got type object
2017-06-20 17:59
549 查看
You need to remove the quotes.
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
<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.
相关文章推荐
- android: OnClickListener cannot be resolved to a type
- android编译错误“OnClickListener cannot be resolved to a type”解
- Android开发报错:GoogleApiClient.isConnected()' was expected to be of type interface but instead was ...
- Error:OnClickListener cannot be resolved to a type
- 【android】:OnClickListener cannot be resolved to a type
- android编译错误“OnClickListener cannot be resolved to a type”解决方案
- 关于“OnClickListener cannot be resolved to a type”问题
- android编译错误“OnClickListener cannot be resolved to a type”
- Android:OnClickListener cannot be resolved to a type
- Android:OnClickListener cannot be resolved to a type
- Object of type 'String' cannot be converted to type 'Function'
- OnClickListener cannot be resolved to a type
- android编译错误“OnClickListener cannot be resolved to a type”解决方案
- 【转】OnClickListener cannot be resolved to a type
- android编译错误“OnClickListener cannot be resolved to a type”解决方案
- Value of type java.lang.String cannot be converted to JSONObject
- 浏览器提示Uncaught TypeError: object is not a function XXX onclick
- error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To di
- OnCheckChangeListener cannot be resolved to a type
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)