React-使用功能评估Prop值的错误

发布于 2025-02-10 13:33:02 字数 285 浏览 1 评论 0原文

在下图中,我正在尝试用第121行替换第120行(在不注释时起作用),以便我可以在第98行的函数中添加其他逻辑。

但是,我看到了错误“ prop 的无效值”值

”在此处输入图像描述”

In the picture below, I'm trying to replace line 120 (which works when not commented) with line 121 so that I can add additional logic in the function on line 98.

However I am seeing error "Invalid value for prop value"

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

东北女汉子 2025-02-17 13:33:02

您正在传递箭头功能,而不是一个值。应该是

value={this.getValue(data, name, catIndex, fieldIndex, type, value)}

You are passing an arrow function rather than a value. It should be

value={this.getValue(data, name, catIndex, fieldIndex, type, value)}
东京女 2025-02-17 13:33:02

您的getValue(1,2,3,4)功能具有4个参数。但是您用6个参数称呼它。

value={()=> this.getValue(data, name, catIndex, fieldIndex, type, value)}

PS ...不要用图片上传代码。复制和粘贴并不困难。

Your getValue(1,2,3,4) function has 4 parameters. But you called it with 6 parameters.

value={()=> this.getValue(data, name, catIndex, fieldIndex, type, value)}

PS... do not upload your code with picture. copy and paste is not difficult.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文