Allennick
Allennick

Reputation: 487

Display images in react fetched from Pinata

I would like to retrieve an image from Pinata and display it in a page in react. This is the image:

https://gateway.pinata.cloud/ipfs/Qmc3gWiMKiRhnc61oSL3nR4Dg5NfJArNiQ2DZA6wpppKT4

How can I retrieve this image and display in a

<img>

Thank you in advance

Upvotes: 2

Views: 1240

Answers (1)

Singh3y
Singh3y

Reputation: 381

You can embed the image url if it's fixed. Or pass a imageUrlFetched variable if you're fetching it from an API

<img src="https://gateway.pinata.cloud/ipfs/Qmc3gWiMKiRhnc61oSL3nR4Dg5NfJArNiQ2DZA6wpppKT4" />
<img src={imageUrlFetched} />

It renders it correctly in your webpage

Upvotes: 2

Related Questions