0

I'm trying to figure out how I should type the input event of my handleEnter function.

I have the following TS error : Property 'value' does not exist on type 'EventTarget'. I tried to use ChangeEvent, but then key property does not exist on that type.

const handleEnter = (e: KeyboardEvent<HTMLInputElement>) => {
    if (e.key === 'Enter') {
      emailSetter(newEmail);
      e.target.value = '';
    }
  };
RomainM
  • 149
  • 7

0 Answers0