title: ScrollToIndex out of range: requested index 1 is out of 0 to 0
body: <p>I am using CalendarList component of react-native-calendars within CalendarList I set pastScrollRange and futureScrollRange as per the conditions shown bellow</p>
  <pre><code>    const [showNextMonth, setShowNextMonth] = useState&lt;number&gt;(1)
      const [showPrevMonth, setShowPrevMonth] = useState&lt;number&gt;(1)
  
      useEffect(() =&gt; {
          setShowPrevMonth(moment(today).month() + 1 &gt; moment(startDateToBeShown).month() + 1 ? 1 : 0)
          setShowNextMonth(moment(today).month() + 1 &lt; moment(endDateToBeShown).month() + 1 ? 1 : 0)
      }, [startDateToBeShown, endDateToBeShown])
  </code></pre>
  <p>And using CalendarList as bellow</p>
  <pre><code>    &lt;CalendarList
          ref={calendarRef}
          current={today}
          calendarHeight=&quot;auto&quot;
          theme={calTheme}
          firstDay={1}
          dayComponent={generateDayComponent}
          monthFormat={'MMMM'}
          hideExtraDays={true}
          markedDates={formattedMergedDays}
          futureScrollRange={showNextMonth}
          pastScrollRange={showPrevMonth}
          maxDate={endDateToBeShown}
          scrollEnabled={true}
      /&gt;
  </code></pre>
  <p>The error I am getting only for pastScrollRange screenshot is attached below.
  The calculated value for pastScrollRange as per the current conditions and date will be 1. With this current implementation, I am getting errors. But if I manually set pastScrollRange value to 1 in the above effect then I won't get an error.</p>
  <pre><code>   setShowPrevMonth(1)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/GapV5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GapV5.png" alt="enter image description here" /></a></p>
  <p>in usestate if I use default value 0 for both then also I am getting errors. If console in the library file initial value 0 is going for both of them. Please help me to resolve the issue.</p>