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

215
Visualizações
Particles JS on React nos properly working

I'm trying to use react-particles-js on react. When I load the page, it's not working. But when I change the color of the particle, it works! But it does not refresh the page anymore when I do changes on it. The original color was: #000, I just changed it to #000000 and started working. But when I refreshed the page, it wasn't working anymore.So I passed from the #000000 I had before to #000 again. And it worked again. So I tried to update it using window.onload(just as how I has doing it manually), but doesn't seems to be working.

window.onload = function(){
setTimeout(() => {
 particlesConfig.particles.color.value = "#000000"
console.log(
  particlesConfig.particles.color.value
)}, 1000)}

Please help. I don't really know why it only works when I change the color, but when I refresh it's not working anymore.

If you want to check my code further: code

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

0

Particle js is deprecated now I had the exact same issue. You need to use react-tsparticles instead. it works the exact same so if you istall this and switch out your imports everything will work

about 4 years ago · Juan Pablo Isaza Relatório

0

Try downgrade your react particlejs to version 3.4.1 it work for me.

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