Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
List 在节列表中,如何隐藏空节(数据:[])的节标题_List_React Native_Header_Sectionheader_React Native Sectionlist - Fatal编程技术网

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

List 在节列表中,如何隐藏空节(数据:[])的节标题,list,react-native,header,sectionheader,react-native-sectionlist,List,React Native,Header,Sectionheader,React Native Sectionlist,我正在使用react native的SectionList,无法隐藏数据集空部分的SectionHeader。我只想显示节标题和非空的节行。我就是这样做的: <SectionList renderSectionHeader={({ section }) => ( section.data.length > 0 ? this._renderHeader(section.title) : (null) )} ... /> ( section.d

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

我就是这样做的:

<SectionList
   renderSectionHeader={({ section }) => (
      section.data.length > 0 ? this._renderHeader(section.title) : (null)
   )}
   ...
/>
(
section.data.length>0?此渲染器(section.title):(空)
)}
...
/>