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

195
Views
¿Cómo puedo convertir una animación de línea ondulada en JS a React?

Implementé esta animación de línea ondulada y funciona bien, pero el problema es que debo convertirla a React. Soy bastante nuevo en React, ¿debería usar "useState" y "useEffect"?

Aquí está el código:

 let xs = [] for (var i = 0; i < 300; i++) { xs.push(i) } let t = 0 function animate() { let points = xs.map(x => { let y = 200 + 8 * Math.sin((x + t) /5) return [x, y] }) let path = "M" + points.map(p => { return p[0] + "," + p[1] }).join(" L") document.querySelector("path").setAttribute("d", path) t += 0.5 requestAnimationFrame(animate) } animate() <div className="Startpage"> <svg> <path d="M10,10 L50,100 L90,50"></path> </svg> </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!