birdwingo / react-native-instagram-stories

🚀 Instagram stories is a versatile React Native component designed to display a horizontal scrollable list of user stories, similar to the stories feature found in the Instagram app.
https://birdwingo.com
MIT License
120 stars 34 forks source link

how does pagination works if i have many stories to show? #97

Open Ahsanali012 opened 1 month ago

Ahsanali012 commented 1 month ago

Hi,

I needed to know as right now i am just using 30 number to show maximum 30 stories , but how does pagination works automatically on the scroll ? like if i scroll the page number could be incremented is their any way to do this?

LukasFridmansky commented 1 month ago

Hey, you can check react-native documentation. Maybe you could add this callback to avatarListContainerProps and with event it returns figure out if the scroll is at the end of the view. That is what I can recommend to you for now, but I will think about adding FlashList instead of ScrollView. FlashList has onEndReached callback in itself.

Ahsanali012 commented 1 month ago

Yes FlashList should be added as when scrolled it should call onEndReached so we can paginate

felixyr commented 1 month ago

@LukasFridmansky Thanks for the great work on the library. I support @Ahsanali012 and your suggestion to add FlashList/FlatList. This will give us more control by exposing onEndReached and ListFooterComponent, allowing us to load the next batch of stories and display a spinner. I have thousands of stories in my app and handling paging with the ScrollViewis challenging.

Ahsanali012 commented 3 weeks ago

Is this feature implemented or not if not please allow me to add this feature I want to contribute