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

99
Views
Different way to render an icon REACTJS

I have that error in SonarQube: Remove the declaration of the unused 'Ico' variable.

And thats my code:

const ReactPage = (props) => {
    const {nomeCLasse} = props
    const icon = {};
     icon[opcaoAvaliacao.Satisfeito] = InsertEmoticonRoundedIcon;
     icon[opcaoAvaliacao.Neutro] = SentimentSatisfiedRoundedIcon;
    
     const render = () => {
        const Ico = icon[nomeClasse];
        return <Ico className={`iconeDescricao${nomeClasse}`} />;
      };
}

When I render this way the sonar gives me an error on line 5(const Ico = icon[nomeClasse]).

How do I render an icon in a different way than this with this icon dictionary?

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!