D
D
danilr2020-02-13 12:30:46
React
danilr, 2020-02-13 12:30:46

How to download and open a file in a new React window?

Let's say the doc.docx file is in src/assets/document/doc.docx, how can I download it and open it in a new window?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Klein Maximus, 2020-02-13
@danilr

It all depends on what needs to happen and how.
It's not entirely clear from the context of the question.
The easiest way to open some link in another window is to add target="_blank":
<a href="..." target="_blank">...</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question