Accessing TypeScript EventTarget Properties 2016-11-24

Started getting error TS2339: Property '<prop>' does not exist on type 'EventTarget' errors from code that tries to access<prop> where event is of type React.FormEvent<any> after upgrading TypeScript to in Visual Studio.

Apparently, the SyntheticEvent interface has changed at some point so, that the target property is no longer generic, but currentTarget is.

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: