ClearC2 / react-excel-workbook

MIT License
109 stars 32 forks source link

Saving a file automatically (without a button) #21

Open e-ndrus opened 5 years ago

e-ndrus commented 5 years ago

Sorry for a noob question. Is it possible for this module to trigger file creation without a user having to click on a button? Looking for a solution to do the work this module does but in the background. Thanks for any tips!

shuhad commented 3 years ago

I made it work like this <Workbook filename={props.fileName} element={}

and called this on my useeffect (since its a react app) you can do document.ready or anything useEffect(() => { document.getElementById("downloadBtn").click(); }, []);