See https://facebook.github.io/react-native/docs/sectionlist.html
When one of the Section's is empty (e.a. the data prop is an empty array), I would still like to render the SectionHeader, but also render a component that indicates that the section contains no data.
I know for the FlatList component this is possible using the ListEmptyComponent prop, but how does this work for the SectionList component?
I was hoping for something like this (but it doesn't work):
<SectionList
style={styles.container}
renderSectionHeader={({section}) => <SectionHeader title={section.title} />}
sections={[
{
data: Object.values(this.props.teams),
title: 'Teams',
renderItem: this._renderTeamItem,
keyExtractor: item => item.id,
ListEmptyComponent: this._renderEmpty
},
{
data: Object.values(this.props.invites),
title: 'Invites',
renderItem: this._renderInviteItem,
keyExtractor: item => item.id,
ListEmptyComponent: this._renderEmpty
}
]}
/>