arrow_backBACK TO DRILLS
Blue BelteventslockPREMIUM

e.target vs e.currentTarget - TypeScript Knows the Type of currentTarget but Not target

A form submit handler is typed as FormEvent<HTMLFormElement> and needs to construct a FormData object from the form element.

REACT_MODULE // 0x42
function handleSubmit(e: FormEvent<HTMLFormElement>) {
const data = new FormData(e.target);
}

Why does TypeScript reject e.target here with a type error, and what is the correct fix?

lock

This Drill is Locked

This is a premium drill. Continue on to the next free drill in the sequence.

CONTINUE DRILLarrow_forward
BugDojo
BlogFAQ

© 2026. Carved in code.