#Image breaks down when I denote the path in src attribute

6 messages · Page 1 of 1 (latest)

low furnace
#

From Section 2 Solo project, when I pass in the path along with the props {../Images/${props.item.imageUrl}} my img breaks. However, if I pass in just the props {props.item.imageUrl} the img displays. Why is that? And why do we need the path in the img element? Is it necessary as said in the course?

amber stream
#

I can't remember the exact file structure of the project but I think it's because the images are coming from an actual URL and are not in an Images folder.
Or if they are in an Images folder then that is already included in the imageUrl file path.

cursive current
#

We'd have to see your file structure to know exactly (could you link your project?). My guess is that your path is incorrect - the two dots "../<file path>" means you're going back out to a parent folder whereas one dot "./<file path>" means its in the current folder. Or possibly the formatting of the template string you have in your curly braces - I don't see the tick marks in your example.

low furnace
low furnace
amber stream