DEV Community

Wonuola
Wonuola

Posted on

Argument of type 'HTMLInputElement' is not assignable to parameter of type 'SetStateAction<string>' TypeScript Error

Code error
Error message

How to fix it

  1. It is a change event (ChangeEvent) not a mouse event. Therefore it should be

function handleEmailChange(e: React.ChangeEvent)

  1. There is no need for the target as HTMLInputElement. Rather, it should be

function handleEmailChange(e: React.ChangeEvent<HTMLInputElememt>)

Top comments (0)