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

312
Views
How to stop img tag to convert image into data:image/png base64 format?

I'm using React 17 and importing an image icon as below

import IconA from './myassets/images/Icona.png';

const ImgView = () => {
    return (
      <div>
      <img src={IconA} alt="IconA" />
      </div>
    );
  }

In HTML page its getting converted to base64 string and being rendered as

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4
  //8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="IconA" />

How can I load my icon in img tag without getting it converted to base64 string. I'm getting below CSP error because of above issue

Refused to load data:image/png;base64 ... because it does not appear in the img-src directive of the Content Security Policy
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!