T
T
TamirPgrogramir2021-03-31 12:44:45
React Native
TamirPgrogramir, 2021-03-31 12:44:45

FlatList loading data in both directions?

Hello everyone! I'm trying to implement a calendar on a FlatList.
I ran into a problem that there are no built-in methods for FlatList that would allow loading data when approaching the top of the list and the bottom, I tried to implement an infinite loop carosel of three elements, that is, with each swipe, I completely changed the list and centered it, which turned out to be very slow since the data stupidly did not have time to update, this is due to the fact that after catching the trigger, I did setState, and it, in turn, worked for a long time. in order to simply move to the beginning or end when it hits this month, and to determine the year, keep the year in a separate state, as a result, when scrolling, we either jump over the first month, or rest on the last month and meet emptiness,then very slowly we jump to another month, and it’s not a fact that we will get to it

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question