简体   繁体   English

onChange 不适用于我在 React 中的输入

[英]onChange doesnt work for my inputs in React

I have 2 Inputs on these Inputs I have onChanges.我在这些输入上有 2 个输入,我有 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.通常我使用带有 Constructur 的 ES6 类,但这次我必须使用功能组件,只是不知道我做错了什么。 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我的输入

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM