I'm using ListItem from react native elements in a FlatList, the code is
render() {
return (
<View style={commonStyles.container}>
<List>
<FlatList
data={this.props.questions}
renderItem={({ item }) => (
<ListItem
roundAvatar
title={'nicola'}
/>
)}
/>
</List>
</View>
);
}
The issue is that text ( 'nicola' ) is not rendered
Edit 03/04/2022
The new syntax is available here : https://reactnativeelements.com/docs/components/listitem
I know this is quite late, but I had encountered the same issue.
const list = [
{
name: 'Account',
icon: 'av-timer'
},
{
name: 'Category',
icon: 'flight-takeoff'
},
{
name: 'About',
icon: 'av-timer'
}]
... // some code here
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
{
list.map((item, i) => (
<ListItem
key={i}
title={item.name}
leftIcon={{ name: item.icon }}
/>
))
}
</View>
When I used the above code, only icons were shown, but the issue was resolved when I removed alignItems prop.
Remove
alignItems: "center"
in View
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With