I have below code
<Link className={classes.btnText} key= {props.id}
to= {".pdf" } target="_blank" download>Brochure <span> ↓ </span> </Link>
The issue is i'm not able to give the absolute path. It is getting updated as
localhost:3000/.pdf
Can i know how to give plete url
I have below code
<Link className={classes.btnText} key= {props.id}
to= {"https://s3.amazonaws./pdf/download.pdf" } target="_blank" download>Brochure <span> ↓ </span> </Link>
The issue is i'm not able to give the absolute path. It is getting updated as
localhost:3000/https://s3.amazonaws./pdf/download.pdf
Can i know how to give plete url
Share Improve this question asked Oct 12, 2020 at 9:43 upogupog 5,5468 gold badges55 silver badges86 bronze badges 1-
2
Link
is for "pages" in your router, if you want to send the user somewhere else use a regulara
. – jonrsharpe Commented Oct 12, 2020 at 9:46
3 Answers
Reset to default 5You can use <a>
tag instead
<a href="https://s3.amazonaws./pdf/download.pdf" target="_blank" className={classes.btnText}>
That's how the {Link} works :)
Maybe use <a>
tag instead ?
Yeah because Link builds all the routes from your home/root path which is localhost:3000 in local dev environment. So that's why its appending to that.
use hyperlink tag <a>
instead
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745090528a4610667.html
评论列表(0条)