SectionList throws Warning that is only for FlatList when using flexWrap
See original GitHub issueIs this a bug report?
yes
Have you read the Contributing Guidelines?
yes
Environment
Environment: OS: macOS High Sierra 10.13.2 Node: 9.3.0 Yarn: 1.3.2 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.0 AI-171.4408382
Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.50.4 => 0.50.4
Target Platform: iOS (11.2)
Steps to Reproduce
put flexWrap
on the contentContainerStyle
of a SectionList
:
<SectionList
contentContainerStyle= {{
flexWrap: 'wrap',
flexDirection: 'row',
}}
....
/>
Expected Behavior
It should either display an error/warning message that says that SectionList
doesn’t support flexWrap
or just work.
Actual Behavior
It seems to work but shows a warning:
Warning: `flexWrap: `wrap`` is not supported with the `VirtualizedList` components.Consider using `numColumns` with `FlatList` instead.
The warning originates here: https://github.com/facebook/react-native/blob/a8391bde7d757d01521a6d12170fb9090c17a6a0/Libraries/Lists/VirtualizedList.js#L720
A warning from VirtualizedList
shouldn’t refer to FlatList
. This issue has been reported before in #15772 and #13460. People suggest that using flexWrap
works fine for them, so probably the warning should be removed. Otherwise, the warning should be thrown from SectionList
and not refer to FlatList
, since SectionList
doesn’t have a numColumns
prop.
Reproducible Demo
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:5
Top GitHub Comments
This is still a problem. I marked the line in the source code that causes it. This bot gets more aggressive every time.
Reopened in new issue #18079