Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
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 answers
Answer question

0

May I suggest the react-spring library?

about 4 years ago · Juan Pablo Isaza Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!