0

I have images saved in a folder in my React app but for some reason when I pass their location link as props it does not show in my card...

<div className={projectCardColor}>
   <img src={props.img} alt="No Image" />
   <h4>{props.text}</h4>
   {props.liveLink && <Button><a href={props.liveLink}>Live</a></Button>}
   <Button><a href={props.githubLink}>Github</a></Button>
</div>

Here is the file that I pass the props.

{
            id: 'a8',
            img: '../assets/images/project-images/test.png',
            text: 'Some Text',
            githubLink: 'some link'
},

If I change the image link to some online link it works properly but not for internal link. Any ideas? If I define this image link as a parameter inside the component file it works properly but passing it as props break it. How come it works like that?

Codecygen
  • 121
  • 1
  • 1
  • 10
  • Please try it ```No Image``` – Vida Hedayati Mar 09 '22 at 06:24
  • says unexpected token. – Codecygen Mar 09 '22 at 06:27
  • Please try `console.log(props)` within the function to see if you get the object, and view it on your console when you're running it in localhost. –  Mar 09 '22 at 06:30
  • Not sure why this is closed. The link redirected does not have any mention on how to pass it as props. They are just import methods which has no problem and I already tried. This is hilarity. I don't wanna just show one specific picture but many as props. – Codecygen Mar 09 '22 at 06:38

0 Answers0