📅  最后修改于: 2022-03-11 15:02:25.205000             🧑  作者: Mango
/*
event.target here is an HTMLElement which is the parent of all HTML elements,
but isn't guaranteed to have the property value.
TypeScript detects this and throws the error.
Cast event.target to the appropriate HTML element to ensure it is
HTMLInputElement which does have a value property:
*/
(event.target).value
// Here's another fix that works for me:
(event.target as HTMLInputElement).value