Sarkar
Sarkar

Reputation: 79

Image is not showing in page using react

The image is not showing in webpage. Image code I am using

<img src={{uri: ConfigFile.ImageBaseUrl + carImage}} alt="new xuv's" />

And the output showing in the browser is

 <img src=[object object] alt="new xuv's" />

Upvotes: 0

Views: 84

Answers (2)

Filip Ivanusec
Filip Ivanusec

Reputation: 68

If I am correct you are passing object as URL? So react sees it as object, try to do something like:

<img src={ConfigFile.ImageBaseUrl + carImage} />

Should see it as a string and should load it correctly :)

Upvotes: 1

Rahul Sharma
Rahul Sharma

Reputation: 10111

You don't have to pass an object to src, You can pass the image URL.

<img src={ConfigFile.ImageBaseUrl + carImage} alt="new xuv's" />

Upvotes: 1

Related Questions