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

243
Views
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
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!