I was having a problem in my React app, where after going through a or the images would not show up. The CSS is defined, and the console shows a 500 error, although I have the pictures etc. Some of the code is like this;
<img className="baner" src="/..img/icons/sold-out.png" alt="Item Sold Out"></img>
and some like this
<img className="medium" src={product.image} alt={product.name} />
after doing some research, I found adding a / to the beinning of the path works. For example;
<img className="baner" src="/../img/icons/sold-out.png" alt="Item Sold Out"></img>
That said, I do not how to add this into the second example, or that it would actually even work. Trying;
<img className="medium" src=/{product.image} alt={product.name} />
produces errors, as does
<img className="medium" src='/{product.image} alt={product.name} />
<img className="medium" src={/{product.image}} alt={product.name} />
etc. I'm not sure how to make this work. Any help appreciated.