I'm trying to implement a horizontal scrolling list that has two rows. Using FlatList, the vertical scrolling list involves setting numColumns
but there is no equivalent for using rows with horizontal.
I was successfully able to make it render properly, and it works flawlessly. However, a warning gets thrown saying setting flexWrap
is not supported in VirtualizedList
or FlatList
, and to use numColumns. I cannot use numColumns as that is not meant for horizontal lists.
<FlatList
horizontal={true}
contentContainerStyle={{
flexDirection: 'column',
flexWrap: 'wrap'
}}
{...otherProps}
/>
I found the commit where this warning was added, but cannot find the reasoning behind it. There seems to be no way to make this work without a warning being thrown, at least without ditching FlatList entirely. Is there a more appropriate solution for horizontal lists with rows?
References:
- Commit adding warning: https://github.com/facebook/react-native/commit/eac399b
- FlatList Documentation: https://facebook.github.io/react-native/docs/flatlist.html