DEV Community

Cover image for React won't load images...
Josh Wenner
Josh Wenner

Posted on

React won't load images...

Hi guys, new here.

React won't load my images. I have tried countless resources and stack overflow. What is going on?
Image description

Hope this image helps.

I was getting an error from Nam saying that ESlint. That my 'images' like 'GitHub' is an unused Var which you can see it is being used in my code

Top comments (2)

Collapse
 
fjones profile image
FJones • Edited

You've got your braces in the wrong place. The JSX syntax is <Component prop={<expression>} ... />, so in your case <img src={Github} ... />. Alternatively, you can use template strings:

<img src=`${Github}` ... />

, though I would still recommend having the block braces around the expression in general:

<img src={`${Github}`} ... />

You might also want to use the #help Tag in the future, that highlights your post a bit. :)

Collapse
 
joshwen7947 profile image
Josh Wenner

yeah this works now! Thank you!