Under my "img" folder I have 5 folders: ("America", "Europe", "Asia", "Africa", "Australia"). Each of these folders contains several city images (Europe folder will hold London.jpg, Paris.jpg, Rome.jpg etc... for example)
Now, my reducer returns me 2 props. One represent the continent, and the other a city that belongs to the continent held in the previous prop.
What I want to achieve is to dinamically load the city image.
something like this:
var icon = (this.props.myContinent && this.props.myCity) ?
require('./img/'+{this.props.myContinent}+'/'+{this.props.myCity}+'.png');
<Image source={icon} />
I read this and this and they gave me an idea. But I'm still unable to solve this.