error TS2339: Property '<prop>' does not exist on type 'EventTarget' errors from code that tries to access
event.target.<prop> where event is of type
React.FormEvent<any> after upgrading TypeScript 188.8.131.52 to 184.108.40.206 in Visual Studio.
Apparently, the SyntheticEvent
In many cases, the target and currentTarget properties are interchangeable (event handler is attached directly to the control emitting the event, see here for an explanation of the properties). Otherwise, you can get rid of the error message by either using the square bracket notation or by casting to the correct type:
(event.target as HTMLInputElement).propsyntax is required in tsx (TypeScript-JSX) code if doing React).