KPS250 / react-native-flatlist-slider

React Native Image Slider with FlatList
186 stars 46 forks source link

scollToIndex out of range #2

Closed daghass closed 4 years ago

daghass commented 4 years ago

Hi thanks for the great component but i'm receiving scrollToIndex out of range specially when i move to another tab using react-navigation bottom tabs 0c9849af-8bb0-4cff-8966-bc564782479a

KPS250 commented 4 years ago

@daghass Seems it out of bounds exception. Is data getting changed on tab change? It's hard to guess whats the issue with the screenshot. It would be great if you could share sample code of link to the repo to reproduce the issue.

hbittar commented 4 years ago

I have the same problem

        <FlatListSlider
          data={images}
          imageKey={'banner'}
          local
          width={90}
          height={60}
          indicator={false}
        />
ManalLiaquat commented 4 years ago

I am also getting the same error, this is because of changing num of columns in numColumns prop on the go. Flatlist don't support this numColumns should be constant

KPS250 commented 4 years ago

@ManalLiaquat @daghass @hbittar I was able to reproduce the issue and it occurs when loop={false}. Working on it now. Will update the library soon.

KPS250 commented 4 years ago

@ManalLiaquat @daghass @hbittar I have pushed V1.0.2 with the fix. You can try updating the library. Closing this issue.