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

167
Views
scrollToIndex Out of range in react native

I am getting this error one by one on repeat. And because of this my app is closing in live mode. I have 5 to 6 FlatLists and 2 to 3 FlatListSliders in my page where I am getting this error. I do not Know what to do please help. I am applying this code in my code. but it is not working. please help


  const navigationRef = useRef(null);
  const myRef = useRef(null);
  const currentIndex = useRef(0);

  useEffect(() => {
    const timer = setInterval(() => {
      currentIndex.current =
        currentIndex.current === FlatList1.length && FlatLis2.length && FltalIst3.length && ... so on .. FlatList7.length  - 1
          ? 0
          : currentIndex.current + 1;
      myRef?.current?.scrollToIndex({
        animated: true,
        index: currentIndex.current,
      });
    }, 5000);
    return () => clearInterval(timer);
  }, []);
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!