As a beginner in react native, I'm attempting to populate a flat list with images that are stored within the app. My goal is to dynamically set the image source in each iteration. This is my current approach, but I'm in need of assistance.
<FlatList
data={this.state.listData}
renderItem={({ item }) => {
<Image
source={
(item)=>{
switch(item.TypeX){
case '1':
return require('path 1');
case '2':
return require('path 2')
}
}} />
}
</FlatList>