Onchange对我在React中的输入不起作用

发布于 2025-02-09 09:35:05 字数 345 浏览 3 评论 0原文

我对这些输入有2个输入,我有一个on Changes。通常,我与ES6课程一起使用构造室,但是这次我必须使用功能组件,只是不知道我做错了什么。每次我在输入中键入某些内容时,都会说输入的值仍然为空(如果我想读出)。

my const-variables

我的输入

I have 2 Inputs on these Inputs I have onChanges. Normally I work with ES6 Classes with a Constructur, but this time I have to work with functional components, and just don't know what I have made wrong. Everytime I type something in the inputs, it says the value of the input is still empty (if I want to read it out).

my const-variables

my inputs

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

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

发布评论

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

评论(1

爱格式化 2025-02-16 09:35:05

您需要在e.target.value中获取键入的值,而不仅仅是e.value

you need to get the value typed in e.target.value and not just e.value

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