#external link on array / props

19 messages · Page 1 of 1 (latest)

quiet scroll
#

Hello all, I would like to add my netlify link on my array and get it on the images, that way people can directly click on the image to go to the external website - I need help to know how to add a link through an array, thanks

tawdry girder
#

Please share the ProjectCard component

quiet scroll
#

sure

tawdry girder
#

You want whan people clikc the image go to the link you're providing right?

quiet scroll
#

yes

#

I guess it's a <a> to add on my projectCard? not sure how it works

tawdry girder
#

Yes but in react we use something called Link and you should import it first
Like this
import {Link} from "react-router-dom"
And then wrap your image with the Link like this:
<Link to={yourlinkhere}>
<img ..../></Link>

quiet scroll
#

oh, I thought link was for internal links only

#

like for the nav bar

#

thanks a lot, trying now

tawdry girder
#

Im always using Link instead of a in react
I recommend you to read this to understand how to use it and to understand all thing about react router dom

#
quiet scroll
#

thank you but this is for links included in the website, not for external ones

#

working with this :

tawdry girder
#

No problem