Here's another fix that works for me:
(event.target as HTMLInputElement).value
That should get rid of the error by letting TS know that event.target
is an HTMLInputElement
, which inherently has a value
. Before specifying, TS likely only knew that event
alone was an HTMLInputElement
, thus according to TS the keyed-in target
was some randomly mapped value that could be anything.