Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created February 18, 2020 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amandeepmittal/5ca897d0eee9ab70986faa4ce43c283c to your computer and use it in GitHub Desktop.
Save amandeepmittal/5ca897d0eee9ab70986faa4ce43c283c to your computer and use it in GitHub Desktop.
{
listItems.length !== 0 ? (
<FlatList
data={listItems}
keyExtractor={item => item.id.toString()}
renderItem={({ item }) => (
<View style={styles.listItemContainer}>
<View style={styles.listItemMetaContainer}>
<Text style={styles.itemTitle} numberOfLines={1}>
{item.name}
</Text>
</View>
</View>
)}
/>
) : (
<Text style={{ fontSize: 30 }}>You list is empty :'(</Text>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment