1

Hey I have a weird issue in react images. Some images are not showing and some are showing.

This is my simple implementation:

<img src={item?.media?.url} /> 

and when I check the console and then copy the src, the image opens normally. So the url isn't the problem

enter image description here

2 Answers 2

2

Looks like you're trying to hotlink an Instagram image.

You can try downloading the image and then displaying it, or you can just embed the Instagram post

Sign up to request clarification or add additional context in comments.

Comments

1

It seems your URL is broken, cause the way your using it is correct, make sure by clicking on the link, a new tab should open showing the actual image

And make sure the extension of the image is being added, cause on the image that you shared, there is no valid image extension in the URL (.png, .jpg, etc..)

3 Comments

clicking on the link will open the image in the browser.
Also the extension is .jpg. So, I don't understand why this is happening
hmm, okay try making it a separate component, and pass the URL only from props, without using '?' (item?.media?.url), and wrap the component with a condition to check if the media & URL exists inside the item then render that image component

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.