I stored images locally in project folder, and I want to add a variable (nature.png) inside image source (with require), so I did like this
let i = 'natrue';
let imagePath = require('../asset/gallery/image/');
return (
<View >
<Image source={{imagePath} + i + '.png'}/>
</View>
But I got an error:
text string must be rendered within a text component
And I dont want to do like this (Works fine) because I have more than 100 images:
<Image source={require('../asset/gallery/image/nature.png')} />