1

So when i import the img Example:

import Logo from "../images/logo.png"

            <img src={Logo}/>

it works but when I do the path only in src it doesnt work at all:

<img src"../images/logo.png"/>

and im new to react so idk how to use props in the import way like <img src={../images/${props.img}} /> but when i update the img to app.js im trying for at least 2 hours but i cant find the solution how to fix it cuz it doesnt show the img

  • What's your question? The former is the correct way and the latter isn't. That behavior is expected. Please see [ask] and take the [tour]. – isherwood Oct 20 '22 at 13:58
  • Does this answer your question? [How do I reference a local image in React?](https://stackoverflow.com/questions/39999367/how-do-i-reference-a-local-image-in-react) – isherwood Oct 20 '22 at 14:00

0 Answers0