I'm new to react native i'm trying to populate flat list with images. All the images are stored inside the app. I want to set image source dynamically in every iteration. This is what I tried. Please help me.
<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>