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

151
Visualizações
Why is not the react style being removed when the component is unmounted?

I have 2 pages:

  • Home (React Class Component)
  • CreatePost (React Functional Component)

Both of them have a style class with the same name '.Grid'.

When I'm in the CreatePost page and go to the Home page then the Home Page keep the .Grid from the CreatePost page.

Should not the styles be removed when the React functional component is unmounted (when I exited the page)?

I'm importing the styles like 'import ./Home.css' and 'import ./CreatePost.css'

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

React won't remove the CSS you import, since it is not React component. You can consider using styled-component.

about 4 years ago · Juan Pablo Isaza Relatório
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