How to make types for form inputs?
const Index = () => {
const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {
e.preventDefault()
console.log(e.currentTarget.elements.email)
}
return (
<Layout>
<form onSubmit={handleSubmit}>
<input name='email' type='email' autoComplete='email' required />
<input name='password' type='password' autoComplete='password' required />
<button type='submit'>Login</button>
</form>
</Layout>
)
}
Type error:
Property 'email' does not exist on type 'HTMLFormControlsCollection'.