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

171
Visualizações
How can I implement theme switching in 'react-calendar'?

So I needed to restyle 'react-calendar', and as stated in Readme on NPM, I imported the original stylesheet. For some reason, editing it didn't affect the style, but I worked around this issue by importing a new file with contents copied from the original one. But my problem is that I have an app with the possibility of switching between light and dark themes, and I can't figure out how to implement this functionality in 'react-calendar' component.

I dug around in the source files and found a variable called baseClassName in Calendar.jsx file. I suggested that classes of child components are generated programmatically based on baseClassName's value, so I can just change it to 'react-calendar-light' or 'react-calendar-dark' to get the effect I'm after. But changing the value didn't even affect the parent div's class name, as stated by the browser console. Besides, I found mentions of other classes like '.react-calendar__tile' in other files, so it appears that my theory is incorrect.

Is there any way to achieve the effect I'm after without severely modifying 'react-calendar'? I'm not that experienced yet, and I'm afraid I'll just mess the component up beyond repair.

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