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

149
Visualizações
What is the proper way to smoothly scale an element to nothing and then back to its original size

This is how I do it in React:

  const animate_boxes = () => {
    inner_ref.current.style.transform = "scale(0)";
    setTimeout(() => {
      if (inner_ref && inner_ref.current) {
        inner_ref.current.style.transform = "scale(1)";
      }
    }, 200);
  };

For some reason, it is not dependable. the setTimeout may not always get run. Still haven't figured out why yet. But If there is an alternative way to do it, then please write a solution.

thanks

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

0

May I suggest the react-spring library?

about 4 years ago · Juan Pablo Isaza Relatório

0

Use framer motion library with scale property passed in as an array of values eg :

import {motion} from 'framer-motion'


const Component = () => {
   return (
     <motion.div
         initial={{scale: 1}}
         animate={{scale: [0.1, 1]}}
     >
         hi
     </motion.div>

   )

}

Refer this docs for more examples - Docs

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