我有一个简单的表格。我想输入电子邮件“ filemon@email.com”,但是在总是同时输入所有内容的同时消失,在控制台中,我遇到了这些错误。它发生在“ e”之后,因此在我的输入中有“文件”。
const [username, setUsername] = useState('');
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [repeatPassword, setRepeatPassword] = useState('');
return (
<Container>
<Segment color='black'>
<Form onSubmit={() => handleSubmit({username, email, password, repeatPassword}, props.history)}>
<Form.Input icon='user' iconPosition='left' label='Username' placeholder='Username' name='username'
value={username} onChange={(e: React.FormEvent, {value}: FormInputProps) => setUsername(value)}/>
<Form.Input icon='mail' iconPosition='left' label='Email' placeholder='Email' name='email'
value={email} onChange={(e: React.FormEvent, {value}: FormInputProps) => setEmail(value)}
type={email}/>
<Form.Input icon='lock' iconPosition='left' label='Password' placeholder='Password' name='password'
value={password} onChange={(e: React.FormEvent, {value}: FormInputProps) => setPassword(value)}
type='password'/>
<Form.Input icon='lock' iconPosition='left' label='Repeat Password' placeholder='Repeat Password'
name='repeatPassword'
value={repeatPassword}
onChange={(e: React.FormEvent, {value}: FormInputProps) => setRepeatPassword(value)}
type='password'/>
<div className='registerForm__button--center'>
<Button type='submit' primary icon='signup' content='Register'/>
</div>
</Form>
</Segment>
</Container>
);