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

89
Views
Cómo copiar una imagen de React a una diapositiva de carrusel

Hice una diapositiva de carrusel que se mueve desde el índice (0 ~ longitud). Quiero hacer una diapositiva que se mueva indefinidamente. ¿Puedo pedir su consejo?

reaccionar js

 const IMAGE = 1084; const slideRef = useRef(); const [index, setIndex] = useState(0); const prevIsCardHandler = () => { if (index === 0) { return; } setIndex(prev => prev - 1); slideRef.current.style.transform = `translateX(-${IMAGE * (index - 1)}px)`; }; const nextIsCardHandler = () => { if (SLIDE_CARD_DATA.length - 1 === index) { return; } else { setIndex(prev => prev + 1); slideRef.current.style.transform = `translateX(-${ IMAGE * (index + 1) }px)`; } }; <CardWrap ref={slideRef}> {SLIDE_CARD_DATA.map(data => { return ( <Card key={data.id} style={{ backgroundImage: `url(${data.src})` }} /> ); })} </CardWrap>
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!