0

PDF in react app

How can I add pdf files in my react app, so others can download it? Without a back-end or anything. Just like putting some pdf files in a folder inside "src" and users will be able to click on download and get the full pdf file downloaded.

15th Jun 2022, 11:15 PM
TheWitcher
TheWitcher - avatar
2 Respuestas
+ 2
Put the pdf in the correct place and set react render with <PdfDownload/> component. // react component const PdfDownload = () => <a href='/fileabc.pdf' download>Click to download pdf file</a>
15th Jun 2022, 11:43 PM
Calviղ
Calviղ - avatar
+ 1
So I just need jsx and write this simple html code? Never thought about it. Thanks
15th Jun 2022, 11:50 PM
TheWitcher
TheWitcher - avatar