I have created cardView but how can I convert it to <FlatList/> I am not able to understand what should be the renderItem of FlatList ?
My current code:
<ScrollView style={styles.container}>
<View style={styles.cardView}>
<Text style={styles.projectName}>{marketing_updates.length != 0 ? marketing_updates[0].project_name: ""}</Text>
<Text style={styles.title}>{marketing_updates.length != 0 ? marketing_updates[0].title: ""}</Text>
<Text style={styles.description}>Description: {marketing_updates.length != 0 ? marketing_updates[0].description: ""}</Text>
<Image
style={styles.img}
source={{uri: marketing_updates.length != 0 ? marketing_updates[0].image: null}}
/>
<View style={styles.buttons}>
<Text style={styles.like}>Like</Text>
<Text style={styles.share}>Share</Text>
</View>
<View style={styles.comment}>
<Text>Comments: </Text>
<Text>comment 1</Text>
<Text>comment 2</Text>
<Text>comment 3</Text>
</View>
</View>
</ScrollView>
How can I convert it to FlatList ?
What I tried :
<ScrollView style={styles.container}>
<FlatList
data={marketing_updates.length != 0 && marketing_updates ? marketing_updates : null}
renderItem={}
/>
</ScrollView>
I am not able to understand what should be there inside renderItem={} ?