System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
Memory: 1.35 GB / 7.87 GB
Binaries:
Node: 10.15.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.17.3 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312
React Native version: 0.60.4
<FlatList
style={{
flexDirection: 'row',
marginHorizontal: -wp('3%'),
zIndex: 40
}}
initialNumToRender={10}
data={this.state.data}
horizontal={true}
key={item => item.groupNo}
keyExtractor={(item, index) => index.toString()}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
ref={ref => (this.flatList = ref)}
renderItem={({ item }) => (
<Item item={item} />
)}
/>
I18nManager.allowRTL(true)I18nManager.forceRTL(true)As you see below when my app is running on RTL direction FlatList automatically scrolls to top/first of the list but LTR direction is OK!
RTL:

LTR:

I also have a same this problem, and my solution (you add them in your Flatlist). Hope help you. This link maybe help you improve your list: https://github.com/filipemerker/flatlist-performance-tips
getItemLayout={(data, index) => (
{ length: LECTURE_ITEM_HEIGHT, offset: LECTURE_ITEM_HEIGHT * index, index }
)}
maxToRenderPerBatch={20}
initialNumToRender={10}
windowSize={10}
removeClippedSubviews={true}
it's a major issue, also causes a problem with react-native-calendars.
for now, you can check onScroll event, on init it causes major scroll event, you can simply return false there and block the scroll. I hope a better solution will come in the next verisons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With