After upgrading to react-native 0.61 i get a lot of warnings like that:
JavaScript
x
2
1
VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.
2
What is the other VirtualizedList-backed container
that i should use, and why is it now advised not to use like that?
Advertisement
Answer
If someone’s still looking for a suggestion to the problem that @Ponleu and @David Schilling have described here (regarding content that goes above the FlatList), then this is the approach I took:
JavaScript
1
7
1
<SafeAreaView style={{flex: 1}}>
2
<FlatList
3
data={data}
4
ListHeaderComponent={ContentThatGoesAboveTheFlatList}
5
ListFooterComponent={ContentThatGoesBelowTheFlatList} />
6
</SafeAreaView>
7
You can read more about this here: https://facebook.github.io/react-native/docs/flatlist#listheadercomponent
Hopefully it helps someone. 🙂