【发布时间】:2020-03-23 06:07:14
【问题描述】:
我正在尝试让一个 login form 做出反应。但我收到了这个错误
React 无法识别 DOM 元素上的 handleChange 属性。如果您有意希望它作为自定义属性出现在 DOM 中,请将其拼写为小写 handlechange。
输入值也没有设置输入字段当我输入input字段时它没有更新状态为什么?
这是我的代码 https://codesandbox.io/s/quirky-clarke-qbkjw
<form noValidate>
<TextBox
label="Username"
name="username"
type="text"
helperText="Assistive text"
handleChange={handleChange}
handleMouseDownPassword={handleMouseDownPassword}
value={userId}
/>
<TextBox
label="Password"
name="password"
type="password"
helperText="Assistive text"
value={password}
showPassword={showPassword}
handleChange={handleChange}
handleClickShowPassword={handleClickShowPassword}
handleMouseDownPassword={handleMouseDownPassword}
/>
<div className="button-group">
<button>LOGIN</button>
</div>
</form>
【问题讨论】:
标签: javascript reactjs