DEV Community

Salah Hasanin
Salah Hasanin

Posted on

Answer: New Typescript 1.8.4 build error: “ Build: Property 'result' does not exist on type 'EventTarget'. ”

https://stackoverflow.com/a/59414838/11803283

If anyone is finding the simplest solution then this worked for me.

var reader:any,
target:EventTarget;
reader= new FileReader();
reader.onload = function (imgsrc){
//var fileUrl = imgsrc.target.result; //change to
var fileUrl = (imgsrc.target as FileReader).result; //cast to correct type
}

Top comments (0)