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

170
Views
¿Cómo puedo hacer esto infinito? Quiero mover el primer elemento de una matriz a la última posición usando React Js

Estoy creando este control deslizante infinito automático en React Js pero no es infinito. Estoy pensando que la mejor manera de hacerlo infinito es mover el primer elemento hasta el final y hacerlo en setInterval de esa manera, mi matriz siempre está intercambiando posiciones.

 export const Slider = ({ images }) => { const [position, setPosition] = useState(0); useEffect(() => { const interval = setInterval(() => { setPosition(prev => prev + 0.1); }, 1000); }, []); const containerVar = { hidden: { x: 0, }, show: { x: -250 * position, transition: { repeat: Infinity, duration: 2, ease: 'linear' }, }, }; return ( <Container as={motion.div} variants={containerVar} initial='hidden' animate='show' > {images.map(({ name, ...imagesData }) => ( <CardClients key={name} name={name} {...imagesData} /> ))} </Container> ); };
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!