在 SectionList 中,如何隐藏空节的节标题(数据:[])

Gen*_*y91 3 header list sectionheader react-native react-native-sectionlist

我正在使用 react-native 的 SectionList 并且无法隐藏数据集空白部分的部分标题。我只想显示部分标题和非空部分的行。

And*_*mon 12

这就是我所做的:

<SectionList
   renderSectionHeader={({ section }) => (
      section.data.length > 0 ? this._renderHeader(section.title) : (null)
   )}
   ...
/>
Run Code Online (Sandbox Code Playgroud)