0

let target: any = e.target;
if (target.nodeName) //other code

Results in a typescript? error wherein it says that Property 'nodeName' does not exist on type 'EventTarget'. but if I refactor the variable name to something that isn't target it works

i don't understand

Comments
  • 1
    You have another Class with the same name.
    Rename. Works? Done.
  • 0
    maybe target is a reserved keyword not meant to be tampered with?
Add Comment