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

133
Views
La animación de React Spring se ralentiza

Tengo una animación de rotación simple de resorte de reacción con velocidad ajustable. Pero una vez que configuré la velocidad al máximo (configuré la duración en 10 ms) y la devolví a menos de 1 segundo, no se animaba correctamente y más bien se retrasaba.

Aquí está la vista previa de la animación https://3l3kb.csb.app/

Y aquí está la caja de arena https://codesandbox.io/s/spring-anim-test-forked-6wno4

Y aquí está el código

 export default function App() { const [reverse, setReverse] = useState(false); const [speed, setSpeed] = useState(50); const rotation = useSpring({ from: { transform: "rotate(0deg)" }, to: { transform: "rotate(360deg)" }, loop: true, reset: true, config: { duration: 10 + (100 - speed) * 10 } }); return ( <div className="App"> <h1>Hello CodeSandbox</h1> {/* <animated.div> <animated.h1>{num.get().toFixed(2)}</animated.h1> </animated.div> */} <div style={{ width: "300px", height: "300px", position: "relative", margin: "auto" }} > <animated.div style={{ ...{ ...rotation, marginLeft: "auto", position: "absolute", color: "purple", fontSize: "130px" } }} > T </animated.div> </div> <input type="range" value={speed} onChange={(e) => setSpeed(e.target.value)} style={{ marginTop: "100px", width: "500px" }} /> </div> ); }
about 4 years ago · Juan Pablo Isaza
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!