gpt4 book ai didi

javascript - 未捕获错误 : Expected onClick listener to be a function, 而得到类型字符串

转载 作者:行者123 更新时间:2023-12-03 04:04:03 25 4
gpt4 key购买 nike

This is the button where i called the handleClick function. I think the onClick event isn't working properly (only works if i equal it to console.log('button clicked) which logs the string to the console.)

This is the handleClick() function which passes the value to the property of the component.

我不知道为什么它不起作用。以前 onClick 会自动启动,但现在没有这个问题。

P.s:我尝试了 IIFE int onCLick 事件,它仍然将消息记录到控制台,但它似乎不适用于 handleClick() .

提前致谢。 :)

最佳答案

尝试如下:

handleClick:function(){
return(this.props.onClick('app/src/wallpaperModule/3.jpeg'))
}

关于javascript - 未捕获错误 : Expected onClick listener to be a function, 而得到类型字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44636609/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com