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
Cómo usar correctamente ref con indiana drag scroll para establecer la posición de desplazamiento inicial

He estado intentando implementar el desplazamiento inicial desde https://codesandbox.io/s/react-indiana-drag-scroll-initial-scroll-getelement-99o6q?file=/index.js:317-382

Pero parece que no he tenido mucha suerte haciendo que la referencia funcione, o tal vez sea algo con el ciclo de renderizado.

Aquí está mi código para hacer referencia con los códigos y caja:

 export default function ProjectCarousel() { const container = useRef(null); useEffect(() => { container.current.getElement().scrollTo(0, 240); }, []); return ( <ScrollContainer className="scroll-container" ref={container}> {ProjectData.map(({ id, ...otherProps }) => ( <ProjectImage key={id} {...otherProps} /> ))} </ScrollContainer> ); }

Gracias por cualquier ayuda de antemano

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tienes que usar la propiedad innerRef en lugar de ref

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!