Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
Image is being fetched every time when I change the src of img element in React JS

I am trying to make an image display component which takes an array of image src and displays the images in a layout like shown below. But the problem is that when I click I'm changing the src of the image element, it is fetching the image again. enter image description here

enter image description here

enter image description here

How can I prevent the image from refetching again? The image must only be fetched on the first time. How can I achieve that?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!