score:0

Accepted answer

you want to access the selected file from this.state, not directly from this:

filelocalhandler = event => {
    event.preventdefault();

    const { selectedfile } = this.state;
    let link = document.createelement("a");

    link.href = url.createobjecturl(selectedfile);
    document.body.appendchild(link);
    link.download = selectedfile.name;
    link.click();
    document.body.removechild(link);
};

Related Query

More Query from same tag