I have that error in SonarQube: Remove the declaration of the unused 'Ico' variable.
And thats my code:
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 do this in another way to remove the error?