I have the following event in onSubmit using React and I am changing it from Javascript to TypeScript.
const submitUserHandler = (e) => {
e.preventDefault();
dispatch(
authenticate({
name: e.target.personname.value,
pw: e.target.password.value,
})
);
};
I have tried assigning 'e: React.ChangeEvent' to the event, but it prompts an error like this:
Property 'personname' does not exist on type 'EventTarget & HTMLInputElement'.
How could I specify the type also including personname and password? Thanks!