Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

253
Visualizações
Styled Components: Hover works on react-icons but not custom svg icons

I am trying to create a hover effect on a svg icon using Styled Components. I get the result I want when using a svg from the react-icons library, however the hover does not work for custom svgs that I link from a local folder:

import React from 'react';
import * as f from './FooterElements';
import * as i from 'react-icons/fa';
import { ReactComponent as IconTwitter } from '../../Images/twitter.svg';

<f.SocialIconLink href='https://www.twitter.com/test/' target='_blank' aria-label='Twitter' >
          <i.FaTwitter/> 
</f.SocialIconLink>
<f.SocialIconLink href='https://www.twitter.com/test/' target='_blank' aria-label='Twitter' >
          <IconTwitter/> 
</f.SocialIconLink>

The hover works on i.FaTwitter but does not on IconTwitter. Any idea why that might happen?

The SocialIconLink component that contains the hover effect :

export const SocialIconLink = styled.a`
    color: #fff;
    font-size: 24px;

    &:hover {
        color: #F59AA6;
        transition: 0.3s ease-out;
    }
`;
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda