Skip to content

ScrollToIndex out of range: #4

Description

@augini

Invariant Violation: scrollToIndex out of range: requested index 4 but maximum is 3

I am having this issue just by installing the package and navigating to another screen with react navigation 5.

This issue does not happen if autoscroll is set to FALSE and this issue is only happening on ANDROID. IOS is working fine

STEPS TO REPRODUCE:

Install the library and use it as shown in the sample

MY HOME Component

import React from 'react';
import {StyleSheet, View} from 'react-native';
import {colors, height, images, width} from '../config/globalStyles';
import Screen from '../components/Screen';
import useAuth from '../hooks/useAuth';

import {FlatListSlider} from 'react-native-flatlist-slider';

const imagesTOP = [
{
image:
'https://images.unsplash.com/photo-1567226475328-9d6baaf565cf?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=400&q=60',
desc: 'Silent Waters in the mountains in midst of Himilayas',
},
{
image:
'https://images.unsplash.com/photo-1455620611406-966ca6889d80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1130&q=80',
desc:
'Red fort in India New Delhi is a magnificient masterpeiece of humans',
},
];
const HomeScreen = ({navigation}) => {
const {user} = useAuth();

return (

  <View style={styles.carousel}>

    <FlatListSlider data={imagesTOP} autoscroll />

  </View>

</Screen>

);
};

const styles = StyleSheet.create({
container: {
marginLeft: width * 20,
},
carousel: {
marginTop: height * 35,
marginBottom: height * 30,
marginRight: 12,
},
});

export default HomeScreen;

Screenshot_1599789234

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions