Encountered an issue while attempting to compile my TypeScript code:
typescript Property 'formData' does not exist on type 'Event'?
formElem.addEventListener("submit", (e) => {
// prevent default action on form submission
e.preventDefault();
// create a FormData object to trigger the formdata event
new FormData(formElem);
});
formElem.addEventListener("formdata", (e) => {
let data = e.formData; // error arises at this point.
.
.
})
Attempted to find an Event
sub-type within the Event
type but to no avail.
What am I doing incorrectly in this scenario? Any suggestions would be greatly appreciated.