Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
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 Respuestas
Responde la pregunta

0

May I suggest the react-spring library?

about 4 years ago · Juan Pablo Isaza Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda